Skip to content

Instantly share code, notes, and snippets.

"List":
($a, @b, 1..1000, $c).map( { ... } );
We need the lazy interpolating characteristics of list
context, but we don't want to be preserving every value
(e.g., the 1..1000) that is processed. Also, the elements
that are processed by .map are the original containers.
A "List" (but not the Parcel that produced it) is mutable
because we consume the values as we iterate over the list.
# version 1
sub infix:<Z>(*@@args) {
my @lists = @@args>>.list;
gather {
take @lists>>.shift while all(@lists);
}
}
# version 1
sub infix:<Z>(*@@args) {
my @lists = @@args>>.list;
gather {
take @lists>>.shift while all(@lists);
}
}
@pmichaud
pmichaud / timeline.md
Created September 7, 2011 18:09 — forked from Whiteknight/timeline.md
General timeline of subsystem changes for Dukeleto

Dukeleto asked me to put together a general timeline or checklist of changes that we need to make to Parrot, organized by size and scope of the work, the effort required, and the relative ordering that (I think) is a pretty good way to go about it.

This isn't an "official" timeline or anything like that. It's just my own personal idea for what we should probably be doing, and how hard it will be to do. The items below are listed in a quasi-chronological order in the sense that, left to my own devices, I will probably approach these problems myself in this order. Other people are welcome to tackle things in any order, so

Source files in perl6/nqp repo
------------------------------
.c|.h|.pmc|.ops:
551 src/pmc/qrpa.pmc
195 src/pmc/nqplexinfo.pmc
50 src/pmc/dispatchersub.pmc
731 src/pmc/sixmodelobject.pmc
104 src/pmc/ownedhash.pmc
96 src/pmc/stable.pmc
218 src/pmc/nqplexpad.pmc
pmichaud@kiwi:~/p6/rakudo$ cat z
for size in 1 10 100 1000 10000;
do
code=$(for n in $(eval "echo {1..$size}");
do
echo -n "1;";
done);
echo -n "Expressions in input: $size: " ;
time --format=%e -- ./perl6 -e "$code" || break
done
pmichaud@kiwi:/zip/perl/rakudo-2012.05$ cat z
for size in 1 10 100 1000 10000;
do
code=$(for n in $(eval "echo {1..$size}"); do echo -n "+1"; done);
echo -n "Expressions in input: $size: " ;
time --format=%e -- ./perl6 -e "my \$x = 1$code;" || break;
done
pmichaud@kiwi:/zip/perl/rakudo-2012.05$ sh z
Expressions in input: 1: 0.29
pmichaud@kiwi:/zip/perl/rakudo-2012.05$ cat z
#!/bin/bash
for size in 1 10 100 130 135 137 138 139 140 1000 10000;
do
code=$(./perl6 -e "say '+1' x $size")
echo -n "Expressions in input: $size: " ;
time --format=%e -- ./perl6 -e "my \$x = 1$code;" || break;
done
pmichaud@kiwi:/zip/perl/rakudo-2012.05$ sh z
pmichaud@kiwi:/zip/perl/rakudo-2012.05$ cat z
#!/bin/bash
for size in 1 10 100 130 135 137 138 139 140 1000 10000;
do
code=$(./perl6 -e "say (1..$size).join('+')")
echo -n "Expressions in input: $size: " ;
time --format=%e -- ./perl6 -e "my \$x = $code;" || break;
done
pmichaud@kiwi:/zip/perl/rakudo-2012.05$ sh z
pmichaud@kiwi:/zip/perl/rakudo-2012.01$ sh z
Expressions in input: 1: 0.48
Expressions in input: 10: 0.54
Expressions in input: 100: 0.93
Expressions in input: 130: 1.07
Expressions in input: 135: 1.05
Expressions in input: 137: 1.04
Expressions in input: 138: 1.06
Expressions in input: 139: ===SORRY!===
maximum recursion depth exceeded