Improving std.typecons.defineEnum

2010-10-06 Thread Tomek Sowiński
I remember using defineEnum a few times. From user perspective you have enum names as strings that forms a nasty mixin, not to mention you can't Ddoc single enum values. It felt like stone age. Then I took a look at how it's implemented and saw a bunch of unreadable templates glueing together

Re: Improving std.typecons.defineEnum

2010-10-06 Thread bearophile
Tomek S.: > I remember using defineEnum a few times. Isn't it deprecated now? Bye, bearophile

Re: Improving std.typecons.defineEnum

2010-10-06 Thread Tomek Sowiński
bearophile napisał: >> I remember using defineEnum a few times. > > Isn't it deprecated now? Ah.. it is, got an old release. Still, do you want my stuff? -- Tomek

Re: Improving std.typecons.defineEnum

2010-10-06 Thread Tomek Sowiński
Tomek Sowiński napisał: > enum Eh { Ah, Oh, Uh }// plain vanilla enum > mixin EnumUtils!Eh; // that's all you need, magic happens here Actually, you don't even need the mixin, just 2 functions... -- Tomek

Re: Improving std.typecons.defineEnum

2010-10-06 Thread Andrei Alexandrescu
On 10/6/10 14:18 CDT, Tomek Sowiński wrote: I remember using defineEnum a few times. From user perspective you have enum names as strings that forms a nasty mixin, not to mention you can't Ddoc single enum values. It felt like stone age. Then I took a look at how it's implemented and saw a bunc

Re: Improving std.typecons.defineEnum

2010-10-06 Thread Tomek Sowiński
Andrei Alexandrescu napisał: > That's a good contribution, but I just deprecated enumToString in a > recent commit because D's current introspection abilities made it easy > to define parse and to!string to manipulate enum names. > > I'll be looking forward to other goodies! Thanks, I just saw s