enum to string

Lionello Lunesu lio at lunesu.remove.com
Thu Mar 12 16:42:58 PDT 2009


Nick Sabalausky wrote:
> "Lionello Lunesu" <lio at lunesu.remove.com> wrote in message 
> news:gpc4j3$30a0$2 at digitalmars.com...
>> Oops, sorry, I didn't notice this was the .learn newsgroup. I guess a 
>> patch to the DMD source was not really what you expected. I just got so 
>> anxious!
>>
>> L.
> 
> Hey, solutions are solutions :)  In fact I may very well try that out. I'm 
> not particularly keen on using an ugly mixin to declare all my enums just so 
> that I can use a simple reflection feature like that (which I'd mostly just 
> be using for debugging info anyway).
> 

I'm really glad it's so easy to hack stuff into the compiler. Although 
I'm still strugling to get these new "string expression" to evaluate at 
compile time. The enum.tupleof is done at compile time, the foreach as 
well, but I cannot pragma(msg) the values, nor can they be mixin-ed.. 
Must be some constness flag somewhere?

L.


More information about the Digitalmars-d-learn mailing list