Function calls

Pelle Månsson pelle.mansson at gmail.com
Thu Jan 28 07:50:45 PST 2010


On 01/28/2010 04:28 PM, Steven Schveighoffer wrote:
> On Thu, 28 Jan 2010 10:22:45 -0500, Adam D. Ruppe
> <destructionator at gmail.com> wrote:
>
>> On Thu, Jan 28, 2010 at 11:47:45AM -0300, Leandro Lucarella wrote:
>>> Andrei Alexandrescu, el 28 de enero a las 07:57 me escribiste:
>>> > I need to put it for all front() and empty() declarations. By the
>>> > way I decided that popFront() is not a property. I don't know why.
>>>
>>> Because it denotes an action?
>>
>> I don't think it is that simple - I see popFront; as an action all the
>> same as popFront();
>
> Whether you use parentheses or not, it's not a property. The statement
> of Andrei is that he doesn't know why it's not a property. The simple
> reason is because it's an action.
>
> Now, does popFront; look like an action? Yes. But that is not the case
> being disambiguated. It is collateral damage. Because the compiler
> doesn't understand English, it can't know whether to disallow popFront;
> any more than an ambiguous term like read;. If there were a way to
> enforce "only terms that are clearly denote actions can be called
> without parentheses," I'd be all for it.
>
> -Steve
I do not understand why this is damage at all. It's like collateral 
fluff, not collateral damage.

Also, is there any case where a function is not a property and do not 
denote an action but is still callable without parenthesis? Aside from 
bad naming, of course.



More information about the Digitalmars-d mailing list