Skip to content

Instantly share code, notes, and snippets.

@zoffixznet

zoffixznet/p6.p6 Secret

Created July 19, 2017 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/02c6b10cc15230df3c681332a9d907d2 to your computer and use it in GitHub Desktop.
Save zoffixznet/02c6b10cc15230df3c681332a9d907d2 to your computer and use it in GitHub Desktop.
use nqp;
Seq.^lookup("iterator").wrap: method (|) {
say nqp::getattr(self, Seq, '$!iter').defined ?? 'Not consumed yet' !! 'Already consumed';
say "touched in: ";
for 3..20 { try say "\t -> {.name || <anon>} ({.file}:{.line})" with callframe($_).code }
put();
nextsame;
};
sub foo {
my $s := <a b c>.map: *.uc;
.print for $s;
.print for $s;
}()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment