Function calls

Steven Schveighoffer schveiguy at yahoo.com
Fri Jan 29 11:43:20 PST 2010


On Fri, 29 Jan 2010 14:23:55 -0500, Pelle Månsson  
<pelle.mansson at gmail.com> wrote:

> On 01/29/2010 08:07 PM, Steven Schveighoffer wrote:
>>
>> f.next();
>>
>> Looks like it advances f, even though next isn't a verb. Without the
>> parentheses, it looks like a noop access of a property.
>
> I disagree, it doesn't look like it advances. With the parens, it just  
> looks like a java-style get-function. To me, at least.

If this were Java, I'd agree with you :)  But even on Java, it would have  
to be getNext().

>
>> I'm not too concerned with requiring () on your examples because it's
>> inconsequential to me -- having parentheses isn't *less* clear than not
>> having them. I don't mind if you wish to allow these calls without
>> parens, but there has to still be a way to force the parens.
>
> I disagree. I understand that in some cases we would not want to permit  
> calling with parenthesis, and that calling as assignment is sometimes  
> less than ideal. I do not, however, see any reason to allow forcing of  
> parenthesis for regular functions.

I guess D can't please everybody all the time.  Oh well.

-Steve



More information about the Digitalmars-d mailing list