On Friday, 28 June 2013 at 13:18:39 UTC, bearophile wrote:
John Colvin:

Is there any way of getting the body of a function as a string? (Obviously only when the source code is available to the compiler)

I think that currently there isn't a simple way to do it. What is your use case?

Bye,
bearophile

I want to create a function with an identical body but different parameters: e.g. given a function

int foo(int a){ return a+1; }

automatically create a new function

int foo(int a)(){ return a+1; }


I'm trying to implement a sort of automatic compile-time currying.

Reply via email to