Re: Get and add to function body

2017-10-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/12/17 7:33 PM, Psychological Cleanup wrote: Is there any way to get the function body of a function, delegate, and lambda? I'd also like to extend functions by "wrapping" them at compile time generically. For example, I'd like to get all the properties of a class and add some code to them

Re: Get and add to function body

2017-10-12 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, October 12, 2017 23:33:39 Psychological Cleanup via Digitalmars-d-learn wrote: > Is there any way to get the function body of a function, > delegate, and lambda? I'd also like to extend functions by > "wrapping" them at compile time generically. For example, I'd > like to get all the

Re: Get and add to function body

2017-10-12 Thread Psychological Cleanup via Digitalmars-d-learn
I'd also like to be able to save and store delegates, functions, and lambdas. One can't store the pointer to the function because it will be invalid, so another means is required, any ideas? Save("f", (int){ ... }); // Saves to disk auto f = Load("f"); // Loads from disk f(3);