Proposal: Replace __traits and is(typeof(XXX)) with a 'magic namespace'.
Moritz Warning
moritzwarning at web.de
Mon Nov 2 10:32:06 PST 2009
On Mon, 02 Nov 2009 13:17:36 -0500, Steven Schveighoffer wrote:
> On Mon, 02 Nov 2009 13:17:18 -0500, Andrei Alexandrescu
> <SeeWebsiteForEmail at erdani.org> wrote:
>
>> Don wrote:
>>> [I'm moving this from deep inside a TDPL thread, since I think it's
>>> important]
>>> is(typeof(XXX)) is infamously ugly and unintuitive
>>> __traits(compiles, XXX) is more comprehensible, but just as ugly.
>>> They are giving metaprogramming in D a bad name. I think we need to
>>> get rid of both of them.
>>> A very easy way of doing this is to replace them with a 'magic
>>> namespace' -- so that they _look_ as though they're functions in a
>>> normal module.
>>> Names which have been suggested include 'meta', 'traits', 'scope',
>>> 'compiler'. Personally I think 'meta' is the nicest (and I suggested
>>> two of the others <g>).
>>
>> Another keyword, sigh...
>
> Wouldn't meta *replace* a keyword? i.e. no more __traits.
>
> Maybe I misunderstand the proposal, but that's what I thought.
>
> -Steve
__traits is no keyword from a practical viewpoint.
It is very unlikely to conflict with other names.
More information about the Digitalmars-d
mailing list