Growing a Language (applicable to @attribute design)

Walter Bright newshound2 at digitalmars.com
Wed Nov 14 14:23:16 PST 2012


On 11/14/2012 3:06 AM, Simen Kjaeraas wrote:
> On 2012-43-14 11:11, Walter Bright <newshound2 at digitalmars.com> wrote:
>
>> On 11/14/2012 1:49 AM, renoX wrote:
>>> That's not strictly true: type inference works better for built-in types than
>>> for user-defined types, with "auto x = 1;" x is an int, how do I have the same
>>> type of syntax for MyInt?
>>
>> You can have user-defined literals in D:
>>
>>     auto x = MyInt(1);
>>
>
> But the syntax for built-in types is better, in that you don't need to
> write:
>
> auto x = int(1);
>

If you're going to argue that D should have some facility to create user-defined 
literals that are arbitrary sequences of arbitrary characters, I think you're 
taking Guy's advice way beyond the breaking point.

This is pretty much true about every "principle" of language design. If you use 
that principle to blindly override everything else, you do not get anything useful.

All design is a compromise of competing goals.


More information about the Digitalmars-d mailing list