Named constructors
JN
666total at wp.pl
Wed Jan 9 21:52:00 UTC 2019
On Wednesday, 9 January 2019 at 21:41:34 UTC, Neia Neutuladh
wrote:
> On Wed, 09 Jan 2019 20:54:48 +0000, JN wrote:
>> I was going to say that this post will be mostly ignored and
>> people will
>> present some template magic to partially implement such
>> feature (just
>> add few imports and some boilerplate code),
>> but I guess I got beaten to it :)
>
> It's handy when writing the DIP to have as many workarounds as
> possible. Then you can show why they aren't good enough in
> advance and save a round of drafts.
Perhaps, but sometimes it feels like the language features are
set in stone at this point. As long as you can implement a
language feature X with template magic, even if it's partially
implementing X, it will be used as an excuse why X shouldn't be a
language feature.
I mean, I see the benefits of a lightweight language with
powerful metaprogramming features, but I am also wary of it
ending up with a Lisp Curse (
http://www.winestockwebdesign.com/Essays/Lisp_Curse.html -
especially the part with "Imagine that a strong rivalry develops
between Haskell and Common Lisp. What happens next?" ).
Some language features are almost straight syntax sugar, and
there's nothing wrong with that either. Consider foreach in D. I
am sure it could be implemented with a few mixins, and yet, it is
a language feature.
More information about the Digitalmars-d
mailing list