Is [] mandatory for array operations?

Robert Jacques sandford at jhu.edu
Fri May 7 07:08:22 PDT 2010


On Tue, 04 May 2010 16:19:09 -0400, Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org> wrote:

> 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

Disagreed. I've really come to enjoy parens-less coding, though I know  
others don't like it. But today both camps can write in their preferred  
style and write libraries for each other. Either deciding on an opt-in  
(@property) or opt-out(@!property) basis seems likely to A) kill the other  
programming style or B) lead to a bunch of synaptic load on the programmer  
as they try to remember which style each class uses.


More information about the Digitalmars-d mailing list