This file contains 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
pmichaud@kiwi:~/p6/rakudobrew$ rakudobrew build panda | |
Cloning into 'panda'... | |
remote: Counting objects: 3577, done. | |
remote: Compressing objects: 100% (10/10), done. | |
remote: Total 3577 (delta 2), reused 0 (delta 0), pack-reused 3567 | |
Receiving objects: 100% (3577/3577), 600.22 KiB | 0 bytes/s, done. | |
Resolving deltas: 100% (1531/1531), done. | |
Checking connectivity... done. | |
Already up-to-date. | |
===SORRY!=== |
This file contains 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
Suspending Rakudo support for Parrot | |
This past weekend at FOSDEM 2015, Larry announced that there will likely | |
be a Perl 6 release candidate in 2015, possibly around the September | |
timeframe. What we're aiming for is concurrent publication of a | |
language specification that has been implemented and tested in at least | |
one usable compilation environment -- i.e., Rakudo Perl 6. | |
So, for the rest of 2015, we can expect the Rakudo development team to | |
be highly focused on doing only those things needed to prepare for the |
This file contains 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
Since I know many people are eager for it, here's a very brief summary of GLR-related | |
decisions and accomplishments from #apw2014. In the next 2..3 days I plan to create | |
blog posts with much greater discussion of each. If any seem particularly confusing | |
or troubling to you, perhaps wait for the blog post(s) before panicking. :-) | |
* flattening rules have been revised somewhat | |
+ list assignment and array constructor continue to flatten their arguments (no change) | |
+ for (args) { ... } flattens args (no change) | |
+ .[] never flattens its invocant (consistency, capability, and performance wins) | |
+ function calls tend to flatten their arguments (e.g. "sort", "map", "pick") |
This file contains 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
pmichaud@plum:~/p6/rakudo$ cat ins.p6 | |
my $fh = open("README.md"); | |
for $fh.lines() { | |
say $fh.ins; | |
last; | |
} | |
pmichaud@plum:~/p6/rakudo$ ./perl6 ins.p6 |
This file contains 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
pmichaud@kiwi:~/p6/nqp$ cat pipe1.pir | |
.sub 'main' :main | |
$P0 = new ['Env'] | |
$P0['AAAAAA'] = 'ZZZZZZ' | |
$P1 = new ['FileHandle'] | |
$P1.'open'("echo $AAAAAA", "wp") | |
$P1.'close'() | |
.end | |
pmichaud@kiwi:~/p6/nqp$ install/bin/parrot pipe1.pir |
This file contains 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
pmichaud@plum:~$ cat x.pl | |
#!/usr/bin/perl | |
my @a = 1..10; | |
foreach (grep { $_ % 2 } @a) { $_++; } | |
print "@a\n"; | |
pmichaud@plum:~$ perl x.pl |
This file contains 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
pmichaud@kiwi:~/p6/rakudo$ ./perl6 | |
> my $h = Hash[Str,Int].new; | |
().hash | |
> $h{3} = 'hello'; # okay | |
hello | |
> $h{'hello'} = 'hello'; # fails key check | |
Nominal type check failed for parameter 'key'; expected Int but got Str instead | |
> $h{4} = 15; # fails value check | |
Type check failed in assignment to '$v'; expected 'Str' but got 'Int' |
This file contains 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 foo { | |
state @ENDS; | |
my $foo = 'foo'; | |
mkdir $foo; | |
@ENDS.push: { rmdir $foo }; | |
END { .() for @ENDS } | |
} |
This file contains 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
pmichaud@kiwi:~/p6/rakudo$ cat rcx.p6 | |
sub table ($base,$power) { | |
my $digits = ($base ** $power).chars; | |
printf "%{$digits}s lsb msb\n", 'number'; | |
for ^$power { | |
my $x = $base ** $_; | |
printf "%{$digits}d %2d %2d\n", $x, $x.lsb, $x.msb; | |
} | |
} | |
This file contains 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 msb(Int $self) { | |
return Nil if $self == 0; | |
return 0 if $self == -1; | |
my $msb = 0; | |
my $x = $self; | |
$x = ($x + 1) * -2 if $x < 0; # handle negative conversions | |
while $x > 0xff { $msb += 8; $x +>= 8; } | |
if $x > 0x0f { $msb += 4; $x +>= 4; } | |
if $x +& 0x8 { $msb += 3; } | |
elsif $x +& 0x4 { $msb += 2; } |
NewerOlder