Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Last active July 19, 2017 18:01
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/2c2b0adcbff28412d5284fb65a1fd401 to your computer and use it in GitHub Desktop.
Save zoffixznet/2c2b0adcbff28412d5284fb65a1fd401 to your computer and use it in GitHub Desktop.
$ perl6 foo.p6
Not consumed yet
touched in:
-> sink-all (SETTING::src/core/Any-iterable-methods.pm:459)
-> sink (SETTING::src/core/Seq.pm:195)
-> <anon> (foo.p6:2)
-> CALL-ME (SETTING::src/core/Routine.pm:85)
-> map (SETTING::src/core/Any-iterable-methods.pm:17)
-> map (SETTING::src/core/Any-iterable-methods.pm:11)
-> foo (foo.p6:11)
-> <unit> (foo.p6:1)
ABCAlready consumed
touched in:
-> sink-all (SETTING::src/core/Any-iterable-methods.pm:459)
-> sink (SETTING::src/core/Seq.pm:195)
-> <anon> (foo.p6:2)
-> CALL-ME (SETTING::src/core/Routine.pm:85)
-> map (SETTING::src/core/Any-iterable-methods.pm:17)
-> foo (foo.p6:11)
-> <unit> (foo.p6:1)
Not consumed yet
touched in:
-> sink-all (SETTING::src/core/Any-iterable-methods.pm:459)
-> sink (SETTING::src/core/Seq.pm:195)
-> <anon> (foo.p6:2)
-> CALL-ME (SETTING::src/core/Routine.pm:85)
-> map (SETTING::src/core/Any-iterable-methods.pm:17)
-> is-runtime (SETTING::src/core/Backtrace.pm:321)
-> anon (SETTING::src/core/Exception.pm:339)
-> print_exception (SETTING::src/core/Exception.pm:327)
-> <anon> (SETTING::src/core/Exception.pm:421)
use nqp;
Seq.^lookup("iterator").wrap: method (|) {
say nqp::defined(nqp::getattr(self, Seq, '$!iter'))
?? '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