Skip to content

Instantly share code, notes, and snippets.

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
@pmichaud
pmichaud / gist:55a0a1543a4fd8a17d7c
Last active August 29, 2015 14:07
IO::Handle .ins bug
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
@pmichaud
pmichaud / gist:460bc17afcc5ca93b6b1
Last active August 29, 2015 14:07
APW2014 GLR discussion highlight summary
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")
@pmichaud
pmichaud / gist:05a986a0aa5bb6c16d3c
Created February 4, 2015 19:22
Suspending Rakudo support for Parrot (draft)
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
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!===
$ cat Foo.pm
module Foo {
multi sub infix:<abc> is export(:DEFAULT) { 1 }
}
$ cat test.pl
use Foo;
say 1 abc 2;
$ ./perl6 test.pl
No applicable candidates found to dispatch to for 'infix:abc'
current instr.: '_block52' pc 73 (EVAL_22:53)
$ cat Foo.pm
module Foo {
multi sub infix:<±>($x, $y) is export(:DEFAULT) { 1 }
}
$ cat test.pl
use Foo;
say 1 ± 2;
$ ./perl6 test.pl
Statement not terminated properly at line 2, near "\x{b1} 2;\n"
$ cat Foo.pm
module Foo {
multi sub infix:<±>($x, $y) is export(:DEFAULT) { 1 }
}
$ cat test.pl
use Foo;
say 2 ± 3;
$ ./perl6 test.pl
$ cat x.pir
.sub 'main'
.param pmc args
$S0 = args[1]
say $S0
$I0 = encoding $S0
$S1 = encodingname $I0
say $S1
$I0 = length $S0
say $I0
$ cat x.pir
.HLL 'xyz'
.sub 'main'
$P0 = get_root_namespace ['parrot';'Integer']
$P0 = get_class $P0
$I0 = get_addr $P0
say $I0
$P0 = get_class ['Integer']