equality operators on types

Bernard Helyer b.helyer at gmail.com
Sat Jun 16 20:21:05 PDT 2012


On Sunday, 17 June 2012 at 02:30:00 UTC, Timon Gehr wrote:
> On 06/17/2012 04:04 AM, Bernard Helyer wrote:
>> Sigh. If you're going to reply like that, it would be nice to 
>> know you
>> had the slightest fucking clue what you're talking about.
>>
>> On Saturday, 16 June 2012 at 11:26:21 UTC, Timon Gehr wrote:
>>> On 06/16/2012 07:19 AM, Bernard Helyer wrote:
>>>> On Friday, 15 June 2012 at 12:56:49 UTC, Timon Gehr wrote:
>>>>> On 06/15/2012 02:19 PM, bearophile wrote:
>>>>>> Timon Gehr:
>>>>>>
>>>>>>> Why not allow equality operators to operate on types?
>>>>>>
>>>>>> That's nice, of course. But is it possible?
>>>>>>
>>>>>
>>>>> Yes, certainly.
>>>>
>>>> Not without losing the context insensitivity of the D 
>>>> grammar (because
>>>> now we can't say for certain what "T == J" is
>>>
>>> It is a comparison. That suffices for the parser. The grammar 
>>> stays
>>> completely context-independent.
>>
>> But we can't say whether T is a type or a value. _That_ 
>> matters.
>>
>
> FROM A PARSER LEVEL, NO!

It absolutely would change the grammar (of the things I've 
written and the things I've studied). It may or may not change 
DMD's grammar, depending on whether it's over generalised -- I 
haven't looked.

It's clear that you think it's not a change of any import, but I 
do.


More information about the Digitalmars-d mailing list