Arbitrary abbreviations in phobos considered ridiculous

Timon Gehr timon.gehr at gmx.ch
Thu Mar 8 02:29:17 PST 2012


On 03/08/2012 03:20 AM, Kapps wrote:
> On Wednesday, 7 March 2012 at 19:12:25 UTC, H. S. Teoh wrote:
>> Supporting stuff like 5.hours will introduce additional complications to
>> D's lexical structure, though. The lexer will have to understand it as
>> (int:5)(.)(ident:hours) rather than (float:5.)(ident:hours). And then if
>> you actually *wanted* a float, you'd have another ambiguity: 5..hours
>> could mean (float:5.)(.)(ident:hours) or (int:5)(..)(hours). And
>> 5.0.hours just looks... weird.
>>
>>
>> T
>
> Actually, Kenji's pull request for UFCS already takes care of this.
> Things like 5. aren't allowed, nor is 5.f; a number has to follow the
> decimal. So 5.f would invoke UFCS function f with the integer 5. I
> believe this change is already merged, though the rest of the UFCS pull
> request isn't unfortunately.

5. is still allowed.


More information about the Digitalmars-d mailing list