Revised RFC on range design for D2

Benji Smith dlanguage at benjismith.net
Tue Sep 30 23:41:50 PDT 2008


Andrei Alexandrescu wrote:
> I stated two principles of language design. They could be true or false. 
> They are up there for debate. They are subjective, because aside from 
> some basics, language design is subjective.
> 
> The principles are:
> 
> 1) A language should minimize the number of syntactic constructs that 
> are semantically and/or pragmatically meaningless.
> 
> 2) The more frequently-used constructs should be given syntactic 
> priority over the less-used constructs, particularly when the latter are 
> also at risk of breaking the first principle.

I'd like to propose another principle of language design:

3) Consistency -- The expression of a semantic construct should always 
use the same syntax. Likewise, multiple uses of the same syntactic 
constructs should always result in the same semantics.

Based on that principle, I'd argue that function-calling should either 
always use parentheses, or it should never use parentheses.

Requiring parentheses for some function calls, but not for others 
violates the principle of consistency.

In my prioritization of language-design principles, consistency is more 
important then syntactic economy.

Based on those principles, I believe that the parentheses should be 
mandatory for all function calls.

--benji


More information about the Digitalmars-d-announce mailing list