implement both signed and unsigned integer division/remainder ops- make callframes variably-sized
- add hashtable implementation: necessary for CHUNK_MAP/linking stage
- use unions instead of uint64_t as register type
- namespacing cleanup (prefix external symbols)
add structure for strings- make integer size configurable or mandate 64-bit integers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use v6; | |
| sub my-subst($self, $matcher, $replacement, | |
| :ii(:$samecase), :ss(:$samespace), | |
| :$SET_CALLER_DOLLAR_SLASH, *%options) { | |
| my $matches := $self.match($matcher, |%options); | |
| return $self unless $matches; | |
| if $matches ~~ Match { | |
| $matches := ($matches,).list; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/config/auto/va_ptr/test_c.in b/config/auto/va_ptr/test_c.in | |
| index f8eb2d4..7dee557 100644 | |
| --- a/config/auto/va_ptr/test_c.in | |
| +++ b/config/auto/va_ptr/test_c.in | |
| @@ -7,7 +7,7 @@ Copyright (C) 2005-2009, Parrot Foundation. | |
| #include <stdarg.h> | |
| #if defined VA_TYPE_REGISTER | |
| -# define PARROT_VA_TO_VAPTR(x) (x) | |
| +# define PARROT_VA_TO_VAPTR(x) ((va_list *)(x)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Copyright 2012 Gerhard R. <gerd.r.devel@googlemail.com> | |
| Permission is granted to use, modify, and / or redistribute at will. | |
| This includes removing authorship notices, re-use of code parts in | |
| other software (with or without giving credit), and / or creating a | |
| commercial product based on it. | |
| This permission is not revocable by the author. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl6 | |
| sub dirwalk($dir = '.', Mu :$d = none(<. ..>), Mu :$f = *, | |
| :&dx = -> $ {}, :&fx = -> $ {}) { | |
| for dir($dir, :test(*)) -> $name { | |
| given "$dir/$name" { | |
| when .IO.f { | |
| &fx.($_) if $f.ACCEPTS($name) | |
| } | |
| when .IO.d { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use v6; | |
| multi sub foo() { | |
| say 'here'; | |
| LEAVE say 'not here'; | |
| } | |
| foo; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void foo(void) | |
| { | |
| static int (*bar)[42]; | |
| static const int (*baz)[42]; | |
| baz = bar; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static inline size_t next_greater_pow2(size_t size) | |
| { | |
| enum { SIZE_BIT = CHAR_BIT * sizeof (size_t) }; | |
| for(unsigned exp = 0; (1 << exp) < SIZE_BIT; ++exp) | |
| size |= size >> (1 << exp); | |
| return ++size; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sub dirwalk(Str $dir = '.', Mu :$d = none(<. ..>), Mu :$f = *, | |
| :&dx = -> $ {}, :&fx = -> $ {}) { | |
| for dir($dir, :test(*)) { | |
| given "$dir/$_".IO but $_ { | |
| when .f { | |
| &fx.(.path) if $f.ACCEPTS($_) | |
| } | |
| when .d { | |
| dirwalk(.path, :$d, :$f, :&dx, :&fx) if $d.ACCEPTS($_) | |
| } |
This is based on reading the spec and not looking at implementations.
- lexical environment -> container
Perl6 features custom containers. In principle, the container could be inlined into the environment as its type is known statically. Another way to do this would be to always inline the default container and add a member referencing the custom one.
- container -> container storage