Revised RFC on range design for D2

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Oct 2 10:26:55 PDT 2008


Bruno Medeiros wrote:
> Andrei Alexandrescu wrote:
>> Bruno Medeiros wrote:
>>> Sergey's argument (which is much more objective than subjective) is 
>>> not strictly against omitting parenthesis, but rather against 
>>> ambiguity (the dual possible ways to call zero-args functions), which 
>>> as has been shown, creates various possibilities for bugs when you 
>>> mix functions that return delegates. This ambiguity problem would 
>>> also be resolved if omitting parenthesis would be *the only way* of 
>>> calling functions with zero-args.
>>
>> Yah, he made great points. There are ambiguities. The counter-argument 
>> is that that would make the syntax of calling functions with no 
>> arguments inconsistent with the syntax of calling function with 
>> arguments. The "()" is a degenerate case of "(a, b, c)". So it's hard 
>> to keep everybody happy.
>>
> 
> Yes, if we solved the ambiguity problem that way, we would make a lot of 
> people unhappy (myself included). But if we solved the problem the 
> *other way* (forbidding omittable parenthesis for normal zero-args 
> function), it would make, that I know of, only one person unhappy (you).

So there is a cabal. I knew it! :o)

I'm not that sure about "lot" and "one", and numbers-based arguments 
aren't that strong to begin with. Language design is complex and full of 
tradeoffs. In each decision there are consequences. If we require "()" 
then we must come with a separate thing for properties - an addition to 
the language. Then many people (maybe even including some the "lot" of 
people you mentioned) will cry foul: "where's my simple language?" etc. 
Maybe some people will say, hey, you were already there with the 
omittable "()" and the "=" thing, why didn't you just make the latter 
less trigger happy and we'd be home free?

One thing that often is a casualty of these discussion is keeping the 
eye on the big picture.

Andrei


More information about the Digitalmars-d-announce mailing list