Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: How to get code of the calling function or object

by nikosv (Chaplain)
on Mar 25, 2011 at 10:47 UTC ( #895443=note: print w/ replies, xml ) Need Help??


in reply to Re^3: How to get code of the calling function or object
in thread How to get code of the calling function or object

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

  • Comment on Re^4: How to get code of the calling function or object

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://895443]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2016-06-30 00:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (388 votes). Check out past polls.