View actions.p6
grammar Enhanced-Paragraph {
token TOP { <superword>[ (\s+) <superword>]+ }
token superword { <word> | <enhanced-word> }
token word { \w+ }
token enhanced-word { \* <word> \* }
}
class Enhanced-Paragraph-actions {
method TOP ($/) { make [~] $/.caps».value.map({ .made // .Str }) }
method superword($/) { make $<enhanced-word>?? $<enhanced-word>.made !! $<word>.made }
View pdf-autosplit.p6
#!/usr/bin/env perl6
use v6;
sub page-numbers-from-chapters($filename) {
my $proc = run :out, 'pdftk', $filename, 'dump_data_utf8';
my %bookmark;
my @borders;
sub handle-bookmark() {
if %bookmark && (%bookmark<BookmarkLevel> // 0) == 1 {
View example-criteria.md

Criteria for Ideas

  • short enough to fit on a single page (usually; at most two)
  • doesn't require too much domain knowledge to appreciate
  • illustrates a Perl 6 feature or concept, preferably two
  • preferably something at least somewhat practical (no mammal hierarchy)
  • not too much setup work (no dependencies on a Zookeeper cluster or so)
View output.txt
moritz@pete:~/src/perl6book$ perl6 examples/uni.p6 dog
⺨ - U+02ea8 - CJK RADICAL DOG (2)
⽝ - U+02f5d - KANGXI RADICAL DOG (2)
🌭 - U+1f32d - HOT DOG (2)
🐕 - U+1f415 - DOG (2)
🐶 - U+1f436 - DOG FACE (2)
View t-spec-S12-attributes-mutators.t
our $count = 0;
class MagicVal {
has Int $.constant;
has Int $.varies = 0;
method varies is rw {
$count++;
return-rw Proxy.new(
# note that FETCH and STORE cannot go through the accessors
View slooow.p6
use v6;
sub timeit(Int $lines-after) {
my $preamble = qq[=begin code\n];
my $str = join "\n", $preamble, "Some more happy, happy lines of B<pod>\n\n including code\n\n" xx $lines-after;
my $before = now;
try EVAL qq[=begin pod\n\n$str\n\n\=end pod\n"];
my $after = now;
View strbuilder-bench.nqp
my @elems := nqp::list('abracadabra', '42', '', 'foobar', 'lskdfjasldfjk',
'abcd', 'zzzzz', 'flurbblerg', 'alsdjfslakdfjs', 'a', 'bb',
'abcd', 'zzzzz', 'flurbblerg', 'alsdjfslakdfjs', 'a', 'bb',
'abcd', 'zzzzz', 'flurbblerg', 'alsdjfslakdfjs', 'a', 'bb',
'abcd', 'zzzzz', 'flurbblerg', 'alsdjfslakdfjs', 'a', 'bb',
'abcd', 'zzzzz', 'flurbblerg', 'alsdjfslakdfjs', 'a', 'bb',
'abcd', 'zzzzz', 'flurbblerg', 'alsdjfslakdfjs', 'a', 'bb',
'abcd', 'zzzzz', 'flurbblerg', 'alsdjfslakdfjs', 'a', 'bb',
'abcd', 'zzzzz', 'flurbblerg', 'alsdjfslakdfjs', 'a', 'bb',
'abcd', 'zzzzz', 'flurbblerg', 'alsdjfslakdfjs', 'a', 'bb',
View TODO
[X] panda meta data service (feather:3000)
[X] dalek (feather3)
[x] perl6.org (feather2)
[x] doc.perl6.org (feather2)
[x] faq.perl6.org (feather2)
[x] perlcabal.org/syn/ (feather)
[X] modules.perl6.org
From other hosts:
[ ] emmentaler smoke server (http://host08.perl6.com:8080/report) => colomon
View puzzle.pl
use 5.014;
use warnings;
my @in = (
[ 'b', 'c', 'f' ],
[ 'a', 'd' ],
[ 'c', 'd', 'e' ],
);
my %indexes = map {; $_ => 1} map @$_, @in;
View grammar-experiment.p6
use v6;
my $re = rx{ a+ };
my $str = 'ab';
my $grammar := (grammar {}).HOW.new_type();
my $HOW := $grammar.HOW;
$HOW.add_method($grammar, 'trans', my proto token trans {*});
$HOW.add_method($grammar, "trans:sym<1>", $re);
$HOW.add_method($grammar, "trans:sym<2>", regex { $str });