Function call without parentheses?
Jesse Phillips
jessekphillips+D at gmail.com
Mon May 9 14:22:33 PDT 2011
Rainer Wrote:
> Hi,
>
> why is it possible to leave out parentheses when you call a function?
>
> This is pretty error prone :(
>
> class Dummy {
> private bool isValid;
>
> ...
> bool isValid() {
> return this.isValid;
> }
> }
>
> Cheers,
> Rainer
It is possible because Walter thought it was an easy/good way to achieve the same goal as those languages that implement a property syntax.
How is this error prone? It doesn't compile.
test.d(4): Error: function test.Dummy.isValid conflicts with variable test.Dummy
.isValid at test.d(2)
More information about the Digitalmars-d-learn
mailing list