> > It would be easy enough to write a macro
A good idea but in my use case I want to be able to turn almost any method into an expression including those in Base which I can't easily add a macro to. Look at code_lowered Thanks, I'll make sure to check that out. I was looking at code_typed and show(::IO, ::LambdaInfo)today which are in the ballpark of what I'm looking for. If I manage to figure out how to extract the information I'm after I'll make sure to make a documentation PR. On Thursday, May 5, 2016 at 9:29:59 PM UTC-5, Steven G. Johnson wrote: > > Look at code_lowered > > f(x) = x + 1 > c = code_lowered(f, (Number,)) > > Getting the AST out of c (an array of LambdaInfo structures) is > undocumented, but possible: Base.uncompressed_ast(c[1]) gives the AST (Expr > object), and Base.lambdainfo_slotnames(c[1]) gives the argument names. > > Might be nice to have a documented way to extract this information. >
