Hacker News new | ask | show | jobs
by _a_a_a_ 931 days ago
Okay, I partly take back what I said in my sibling post. Your "(req) => {..}" lambda has to be constrained only to contain inflight methods.

Yes, it can be done by either building the contents of the lambda in some truly horrid way (you'd effectively be building an AST at runtime). The alternative is to get hold of the AST/parse tree at runtime (which I believe.NET can do if you ask it nicely, but that is very specifically .NET) which you can then analyse.

The first way is utterly vile though workable and language agnostic, the second way is definitely tied to one platform. If there's third way I can't think of it ATM.