|
|
| go ahead... be a heretic | |
| PerlMonks |
Re^4: How to get code of the calling function or objectby nikosv (Hermit) |
| on Mar 25, 2011 at 10:47 UTC ( #895443=note: print w/ replies, xml ) | Need Help?? |
|
directly to modify the AST of a subroutine on the fly I think the issue is that Perl produces an optree rather than an abstract syntax tree;the optree directly represents Perl's concrete syntax while with an AST you have a more abstract view I am under the impression that Perl 6 as well as the other languages for Parrot will output ASTs which will map onto a Parrot Abstract Syntax Tree. One main reason for that is tree transformation/manipulation which allow things that the OP asked for The .NET DLR is a an example of that.It calls the DLR AST as Expressions, which is represented by an intermediate Expressions language;this allows for a myriad of neat tricks.You might want to check Expression Tree Basics
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||