Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

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

by nikosv (Hermit)
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 about the Monastery: (4)
As of 2015-07-06 00:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (68 votes), past polls