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
rakudo$ cat constrains.p6 | |
use v6; | |
my $counter = 0; | |
multi a(Int $x) {}; | |
multi a($x where {$counter++; True}) {}; | |
a(3); | |
say $counter; |
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
diff --git a/src/multi-dispatch.pod b/src/multi-dispatch.pod | |
index 67ce236..eb07595 100644 | |
--- a/src/multi-dispatch.pod | |
+++ b/src/multi-dispatch.pod | |
@@ -144,12 +144,22 @@ this to count how often a type check occurs: | |
=end programlisting | |
-The first counter output is always C<0>, since the nominal types alone already | |
-determine which candidate matches best, so the where-block is never executed. |
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
diff --git a/src/core/IO/Socket/INET.pm b/src/core/IO/Socket/INET.pm | |
index 63d8f4d..9acaf55 100644 | |
--- a/src/core/IO/Socket/INET.pm | |
+++ b/src/core/IO/Socket/INET.pm | |
@@ -2,7 +2,7 @@ class IO::Socket::INET is Cool does IO::Socket { | |
method open (Str $hostname, Int $port) { | |
- Q:PIR { | |
+ my $s = Q: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
$ perl rakudo/tools/bench.pl | |
hello.p6 | |
rakudo-2010.07: 3.873719 seconds | |
rakudo-master: 3.674719 seconds | |
rakudo-star: 3.635399 seconds | |
iteration.p6 | |
rakudo-2010.07: 3.819951 seconds | |
rakudo-master: 3.841175 seconds | |
rakudo-star: 3.683934 seconds | |
recursion.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
$ cat ABC.pm | |
grammar ABC::Grammar is HLL::Grammar { | |
rule TOP { <expr> } | |
rule expr { <integer> <addop> <integer> }; | |
token addop { '+' | '-' } | |
token integer { \d+ } | |
} | |
class ABC::Actions is HLL::Actions { |
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
Create a list of four times 1: | |
Main> flip replicate 1 4 | |
[1,1,1,1] | |
Now do it for every element of the list and get a list of lists: | |
Main> map (flip replicate 1) [4,1,3,2] | |
[[1,1,1,1],[1],[1,1,1],[1,1]] | |
Transpose that twice to get the inner lists sorted by number of elements: | |
Main> transpose(transpose(map (flip replicate 1) [4,1,3,2])) |
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
$ cat test.p6 | |
multi f([]) { () } | |
multi f(@list) { | |
say @list.perl; | |
} | |
my @a = (); | |
f(@a); |
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
use List::Utils; | |
sub beadsort(@l) { | |
(transpose(transpose(map {[1 xx $_]}, @l))).map(*.elems); | |
} | |
my @list = 2,1,3,5; | |
say beadsort(@list).perl; # (5, 3, 2, 1) |
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
$ cat documentation_init.patch | |
diff --git a/lib/System/Introspector.pm b/lib/System/Introspector.pm | |
index c46af7d..8316545 100644 | |
--- a/lib/System/Introspector.pm | |
+++ b/lib/System/Introspector.pm | |
@@ -5,6 +5,37 @@ package System::Introspector; | |
our $VERSION = '0.000001'; | |
$VERSION = eval $VERSION; | |
-# lots of this stuff sponsored by socialflow.com |
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
diff --git a/Makefile.PL b/Makefile.PL | |
index 7c5ca12..3a4b73f 100644 | |
--- a/Makefile.PL | |
+++ b/Makefile.PL | |
@@ -19,7 +19,7 @@ my $mymeta = do { no warnings; $ExtUtils::MakeMaker::VERSION > | |
WriteMakefile( | |
NAME => 'JSON-Diffable', | |
- VERSION_FROM => 'lib/JSON/Diffable.pm' | |
+ VERSION_FROM => 'lib/JSON/Diffable.pm', |
OlderNewer