Things that keep D from evolving?
Matt Elkins via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Feb 10 21:28:30 PST 2016
On Thursday, 11 February 2016 at 05:05:22 UTC, tsbockman wrote:
> On Thursday, 11 February 2016 at 04:51:39 UTC, Matt Elkins
> wrote:
>>> - Syntactic sugars (associtive arrays, powerful foreach,
>>> slices...)
>>
>> I'm still adjusting to the idea of AAs as part of the language
>> rather than library. Not sure I like it, but on the other hand
>> it doesn't really hurt. The foreach construct isn't any better
>> (or worse) than C++'s, unless I'm missing something (which is
>> very possible). But slices are awesome!
>
> In D you can `foreach` over a list of types (AliasSeq) at
> compile time, not just over ranges at runtime. (For the moment,
> it's still only available in function bodies though, unlike
> `static if`.)
Neat! I didn't know that. You can do that in C++, but in typical
fashion not with a convenient foreach statement. You have to do
some crazy type list recursion stuff.
So chalk up another point for D's "ease of metaprogramming" :).
More information about the Digitalmars-d-learn
mailing list