2013/1/25 kenji hara <[email protected]> > > > I have thought an additional idea. > If we really want a feature to disable optional parentheses for normal > functions, we can add @function attribute to the language spec. > > int foo(); > @property int bar(); > @function int baz(); // new! > > int x1 = foo(); // ok > int x2 = foo; // optional parentheses, allowed > int y1 = bar(); // disallowed, calling int is meaningless > int y2 = bar; // ok > int z1 = baz(); // ok > int z2 = baz; // *disallowed* by @function attribute >
I think calling a function which does not annotated with @attribute without parenthesis is legal, Even if a function has some side-effects and a name looks like verb. Because native English grammar does not require parentheses. He runs(). // normal function call He runs. // optional parentheses Kenji Hara
