Getting the string representing the enum value ~ Proposal

pragma pragma_member at pathlink.com
Mon Apr 3 11:49:58 PDT 2006


In article <e0pqn7$1ngo$1 at digitaldaemon.com>, kris says...
>
>I'll propose that a new property be added, somewhat like the .mangleof 
>property. Instead, a .nameof property would simply return the lexical 
>token for the named entity. Doesn't matter whether it refers to a 
>struct, class, some attribute thereof, enum types or members, whatever 
>... the x.nameof should just return a char[] of the respective name.
>
>Thoughts?

It gets my vote - but there are a few kinks to work out.

For instance, how does this compare to .classname or TypeInfo.toString()?

I'd imagine that it would follow the same behavior as .mangleof (possibly all
the way around), with respect to aliases and typedefs.  Templates might be kind
of sticky though -- any ideas on that?

- EricAnderton at yahoo



More information about the Digitalmars-d-learn mailing list