In Perl 6, how can I get name of the function/subroutine from within its body, at runtime?
For example,
sub foo { say "My name is: " ~ <WHAT-API-HERE??> ; } ... foo();
The above code should print:
My name is: foo
I've looked in places like MOP, FAQ, and Functions.
sub foo { say &?ROUTINE.name } foo
displays:
foo
See the &$ROUTINE doc.
&$ROUTINE