Skip to content

Instantly share code, notes, and snippets.

@deoac
Created September 19, 2023 01:18
Show Gist options
  • Select an option

  • Save deoac/1cf9c8141c3468d1619cbee96c787933 to your computer and use it in GitHub Desktop.

Select an option

Save deoac/1cf9c8141c3468d1619cbee96c787933 to your computer and use it in GitHub Desktop.
Trace output of callwith-test.raku
3 (callwith-test.raku line 6)
multi sub count (IO::Path $filehandle!) {
ENTER { say "begin count (IO::Path)" }
my $count = $filehandle.slurp.lines.elems;
say "{$filehandle.basename} has $count lines";
LEAVE { say "end count (IO::Path)"; }
} # end of multi sub count (IO::Path $filehandle!)
15 (callwith-test.raku line 13)
multi sub count (Str $filename!) {
ENTER { say "begin count (Str)" }
say '1'; count $filename.IO;
say '2'; callwith $filename.IO;
say '3'; nextwith $filename.IO;
say '4';
LEAVE { say "end count (Str)"; }
} # end of multi sub count (Str $filename!)
30 (callwith-test.raku line 22)
count $?FILE
17 (callwith-test.raku line 14)
say "begin count (Str)"
16 (callwith-test.raku line 14)
ENTER { say "begin count (Str)" }
19 (callwith-test.raku line 15)
say '1'
20 (callwith-test.raku line 15)
count $filename.IO
5 (callwith-test.raku line 7)
say "begin count (IO::Path)"
4 (callwith-test.raku line 7)
ENTER { say "begin count (IO::Path)" }
7 (callwith-test.raku line 8)
my $count = $filehandle.slurp.lines.elems
8 (callwith-test.raku line 9)
say "{$filehandle.basename} has $count lines"
9 (callwith-test.raku line 9)
$filehandle.basename
11 (callwith-test.raku line 10)
LEAVE { say "end count (IO::Path)"; }
12 (callwith-test.raku line 10)
say "end count (IO::Path)"
21 (callwith-test.raku line 16)
say '2'
22 (callwith-test.raku line 16)
callwith $filename.IO
23 (callwith-test.raku line 17)
say '3'
24 (callwith-test.raku line 17)
nextwith $filename.IO
27 (callwith-test.raku line 19)
say "end count (Str)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment