Revised RFC on range design for D2
Chris R. Miller
lordsauronthegreat at gmail.com
Sun Sep 28 09:20:33 PDT 2008
Sergey Gromov wrote:
> Sat, 27 Sep 2008 23:08:43 -0700,
> Chris R. Miller wrote:
>> Andrei Alexandrescu wrote:
>>> I think we all agree that there are some annoyances related to the whole
>>> property business, among which the main one is:
>>>
>>> writeln = 4;
>>>
>>> That is quite indefensible :o|. I consider the others rather minor, but
>>> that's just a personal opinion.
>>>
>>> How about this. Maybe if we attacked this annoyance in particular, that
>>> would be a large bang for the buck without a landslide change in the
>>> compiler. We only need some way to inform the compiler, "yes, it's ok to
>>> call a.b(c) as a.b = c". Ideas?
>> Just trying to think of something that could be easily parsed...
>>
>> void foo(char t)!={ /*do something with t*/}
>> void bar(char t) { /*do something with t*/}
>>
>> void main() {
>> foo('t'); // okay
>> foo='t'; // not okay because of the "!="
>> bar('t'); // okay
>> bar='t'; // okay
>> }
>>
>> My thinking is that it doesn't break existing code. One could change
>> the order to precede the argument list, but I don't like that as much
>> because it becomes ambiguous when used in conjunction with templates.
>
> I cannot see how trickery with an existing syntax is less a feature than
> a new keyword.
Awe, but making the syntax more complex makes the code look so much more
unfriendly ;-)
My thought process hadn't even touched upon the idea of adding another
keyword. But then what would the keyword be? "noeq"? "noprop"?
"propless"? "muffin"? (I vote for muffin!) ;-)
More information about the Digitalmars-d-announce
mailing list