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); |
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
class C { | |
has $!foo; | |
method foo is rw { | |
say "foo"; | |
$!foo; | |
} | |
has $!bar; | |
method bar is rw { | |
Proxy.new( |
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
.mode columns | |
.headers on | |
.width 80 | |
select | |
case when r.name = "" then "<anon>" else r.name end || " / " || r.file as "name/file", | |
r.line as "line", | |
sum(entries) as entries, | |
sum(case when rec_depth = 0 then inclusive_time else 0 end)/1000.0 as "inclusive(s)", | |
sum(exclusive_time)/1000.0 as "exclusive(s)" | |
from |
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
npm http 304 https://registry.npmjs.org/sha1 | |
npm http GET https://registry.npmjs.org/nqp-js-io | |
npm http 404 https://registry.npmjs.org/nqp-js-io | |
npm ERR! TypeError: Object.keys called on non-object | |
npm ERR! at Function.keys (native) | |
npm ERR! at installTargetsError (/usr/lib/node_modules/npm/lib/cache.js:708:24) | |
npm ERR! at /usr/lib/node_modules/npm/lib/cache.js:638:10 | |
npm ERR! at saved (/usr/lib/node_modules/npm-registry-client/lib/get.js:148:7) | |
npm ERR! at /usr/lib/node_modules/graceful-fs/polyfills.js:133:7 | |
npm ERR! at Object.oncomplete (fs.js:108:15) |