Does D have too many features?

Nick Sabalausky SeeWebsiteToContactMe at semitwist.com
Sat Apr 28 23:35:07 PDT 2012


"Timon Gehr" <timon.gehr at gmx.ch> wrote in message 
news:jnhpvv$ih4$1 at digitalmars.com...
> On 04/28/2012 11:04 PM, Dmitry Olshansky wrote:
>>
>> But how about:
>> alias thing = runSomeCtfe();
>>
>
> That would work in certain cases, where the initializer is not a single 
> symbol. But then, I kinda like the way 'enum' is generalized in D:
>
> enum Foo{
>     member1,
>     member2,
>     member3,
> }
>
> => (allow non-integral enumerations)
>
> enum Foo{
>     member1 = "1",
>     member2 = "2",
>     member3 = "3",
> }
>

Those are good. They are essentially enumerations.

> => (anonymous enums)
>
> enum{
>     member1 = "1",
>     member2 = "2",
>     member3 = "3",
> }
>

I don't think "anonymous enum" makes any sense at all. It's *not* an 
enumeration by any stretch of the term, it's just a series of manifest 
constants. The fact that they're grouped doesn't even have any semantic 
consequence, as far as I'm aware.

> => (a single member is okay)
>
> enum{
>     member1 = "1",
> }
>
> => (syntactic sugar)
>
> enum member1 = "1";
>

Just simpler examples of the above, which isn't any form of enumeration at 
all.

>> And bring the usual alias to new_name = <something>;
>> form (even C++ finally got this right with C++11 aliases).
>>
>
> This is probably something that should be done.
>

Emphatic +1

I always have to stop and think carefully about the order when I write an 
alias.

>
> Implementing a compiler is probably harder for D, because of the interplay 
> of forward references, CTFE and compile time introspection.
>

Those make D more difficult to implement than many languages, but OTOH, 
AIUI, C++ has some real nightmarish details with templates and even just 
simply parsing. Probably some other bizarre cruft, too. IIRC, I think 
Walter's occasionally mentioned something about the...overload rules?




More information about the Digitalmars-d mailing list