Library Typedefs are fundamentally broken
ketmar via Digitalmars-d
digitalmars-d at puremagic.com
Sat Sep 20 09:32:17 PDT 2014
On Sat, 20 Sep 2014 08:25:17 -0700
Andrei Alexandrescu via Digitalmars-d <digitalmars-d at puremagic.com>
wrote:
> I think this is an entirely palatable idiom:
> alias ALfloat = std.typecons.Typedef!(float, "ALfloat");
this is ugly. even if we remove "std.typecons." it's still ugly. making
such core feature ugly is the right way to marginalize it. "what? all
this uglyness only for simple typedef? screw it, i'll go with simple
`alias ALfloat = float;`! oh, wait... this gives me nothing and i
already messed some declarations... ah, screw it, will use `float`
then!"
the whole thing with aliasing Typedef is broken. yes, it's smart to use
library for this (see, our language is THAT powerful!), but it's uuugly.
the same thing as with octal literals: we have 0b, we have 0x, yet it's
very smart to banish octals to phobos and use octal!"660" instead of
logical 0o660. phew.
but i know: octal literals are handy, so they will never make their way
to mainline. "typedef" construct is handy, so...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20140920/8b44fcfc/attachment.sig>
More information about the Digitalmars-d
mailing list