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
# from chr() in nqp/src/vm/jvm/runtime/org/perl6/nqp/runtime/Ops.java | |
if ((val >= 0xfdd0 | |
&& (val <= 0xfdef // non character | |
|| ((val & 0xfffe) == 0xfffe) // non character | |
|| val > 0x10ffff) // out of range | |
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
my $lisp-list = 1 => 2 => 3 => Nil; # it's nice that infix:<< => >> is right-associative | |
Pair.^add_fallback( | |
-> $, $name { $name ~~ /^c<[ad]>+r$/ }, # should we handle this? yes, if /^c<[ad]>+r$/ | |
-> $, $name { # if it turned out to be our job, this is what we do | |
-> $p { | |
$name ~~ /^c(<[ad]>*)(<[ad]>)r$/; # split out last 'a' or 'd' | |
my $r = $1 eq 'a' ?? $p.key !! $p.value; # choose key or value | |
$0 ?? $r."c{$0}r"() !! $r; # maybe recurse | |
} | |
} |
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
our %TestFiles = ( | |
'config1.ini' => q:to"END1", |
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 Test; | |
my $p1000 = start { | |
(1..Inf).grep(*.is-prime)[999] | |
} | |
is $p1000.result, 7919, 'simple promise'; | |
# not exiting on jvm |
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
davidw@app01:~/git/roast$ gdb /home/davidw/git/rakudo/install/bin/moar | |
GNU gdb (GDB) 7.0.1-debian | |
Copyright (C) 2009 Free Software Foundation, Inc. | |
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> | |
This is free software: you are free to change and redistribute it. | |
There is NO WARRANTY, to the extent permitted by law. Type "show copying" | |
and "show warranty" for details. | |
This GDB was configured as "x86_64-linux-gnu". | |
For bug reporting instructions, please see: | |
<http://www.gnu.org/software/gdb/bugs/>... |
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
# courtesy of https://gist.github.com/masak/244255 | |
use v6; | |
enum Suit < ♥ ♦ ♣ ♠ >; | |
enum Rank (2, 3, 4, 5, 6, 7, 8, 9, 10, | |
'j', 'q', 'k', 'a'); | |
class Card { | |
has Suit $.suit; | |
has Rank $.rank; |
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 {say 'outer foo'} | |
sub infix:<bar>($a,$b) {say "outer bar {$a + $b}" } | |
sub infix:<baz>($a,$b) {say "outer baz {$a * $b}" } | |
foo(); | |
2 bar 3; | |
2 baz 3; | |
say; | |
{ |
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 bisections on parrot | |
# david warring 15-09-2014 | |
# -------------------------- | |
sub capture-said($code) { | |
my $output = ''; | |
temp $*OUT = class { | |
method print(*@args) { | |
$output ~= @args.join; | |
} | |
} |
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
% icu-config --unicode-version | |
5.2 | |
% PERL6LIB=t/spec/packages prove -e 't/fudgeandrun --backend=parrot' -v t/spec/S05-mass/charsets.t | |
t/spec/S05-mass/charsets.t .. | |
1..17 | |
ok 1 - ident chars | |
ok 2 - alpha chars | |
ok 3 - space chars | |
ok 4 - digit chars | |
ok 5 - alnum chars |
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 repeat(Str $input --> Rat) { | |
my $phrase := :36($input); | |
my $l := (36 ** $input.chars) - 1; | |
$phrase/$l; | |
} | |
say (repeat('sixrocks') * 36 ** 40).base(36); |
OlderNewer