lambda code

John Colvin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Apr 2 12:27:20 PDT 2015


On Wednesday, 1 April 2015 at 23:29:00 UTC, Vlad Levenfeld wrote:
> On Tuesday, 31 March 2015 at 13:25:47 UTC, John Colvin wrote:
>> On Tuesday, 31 March 2015 at 12:49:36 UTC, Vlad Levenfeld 
>> wrote:
>>> Is there any way (or could there be any way, in the future) 
>>> of getting the code from lambda expressions as a string?
>>>
>>> I've noticed that if I have an error with a lambda that looks 
>>> like, say
>>> x=>x+a
>>>
>>> the error message will come up referring to it as
>>> (x) => x + a
>>>
>>> so some level of processing has already been done on the 
>>> expression. Can I get at any of it during compilation? It 
>>> would be useful for automatic program rewriting.
>>
>> Short answer: no. .codeof for functions is something I've 
>> wanted for ages, but no movement so far.
>
> :(

On a more positive note, there's probably an OK way of achieving
your particular goal without this. Do you have an example?


More information about the Digitalmars-d-learn mailing list