Is [] mandatory for array operations?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue May 4 13:19:09 PDT 2010


Walter Bright wrote:
> Don wrote:
>> Walter Bright wrote:
>>> Don wrote:
>>>> There are several compiler bugs relating to array operations, and 
>>>> almost all relate to this issue. I'd like to fix them, but I need to 
>>>> know which way it is supposed to work.
>>>
>>> The [] should be required. I worry that otherwise there will be 
>>> ambiguous cases that will cause trouble.
>> Excellent.
> 
> Glad we agree. An example is the C hack where if foo is a function, then 
> &foo as well as foo mean the address of the function. This little 
> ambiguity, originally meant as a convenience, has caused much grief.

In the same vein, probably it's time to bite the bullet and require 
@property for parens-less function calls.

Andrei


More information about the Digitalmars-d mailing list