Library Typedefs are fundamentally broken

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Sun Sep 21 12:11:08 PDT 2014


On Sunday, 21 September 2014 at 17:47:57 UTC, Marco Leise wrote:
> Am Sun, 21 Sep 2014 08:04:39 -0700
> schrieb Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org>:
>
>> Why would anyone hope a valid idiom were not mentioned?
>
> It's just what people do when an argument would be
> detrimental to their own position in an argument. :p
> Look, I don't feel strongly about it. Just, from an objective
> point of view, aliases and templates in their current form are
> no good candidates to implement strongly typed typedefs. The
> semantics are too different. A proxy struct for example
> does more cleanly define a new symbol and type with normal
> lookup rules. But let's not waste our energy on this now.
> It is after all a convenience feature, not an enabler like
> shared libraries, ARC or standard logging facilities.

I agree that it is not _that_ important but it feels really bad
to have to reimplement parts of standard library to get semantics
at least somewhat close to promised/expected.

Pretty much only effective difference it makes is that write now
I have a custom Typedef wrapper as part of D1->D2 migration
helpers and initially hoped for forwarding it to
std.typecons.Typedef once migration is over. But considering
Andrei strong position on topic it will stay as in-house mixin
based solution, not a big deal.

I am just surprised Andrei insists so hard on defending solution
that is questionable at best.


More information about the Digitalmars-d mailing list