ufcs and integer params

Jacob Carlborg doob at me.com
Sun Jul 15 23:40:24 PDT 2012


On 2012-07-15 23:56, Jonathan M Davis wrote:

> It's a matter of enforcing the correct syntax, which the compiler does all the
> time. It's just that you don't think that the compiler should care in this
> particular case, since it hasn't cared in the past.

No, it's a matter of _what_ the correct syntax is.

Just as both of these are legal:

if (true)
     writeln(true);

if (true)
{
     writeln(true);
}

Both of these could be legal as well:

void foo ();

foo();
foo;

There are several other languages where the parentheses are optional: 
Ruby, Scala and CoffeeScript to mention a few.

-- 
/Jacob Carlborg




More information about the Digitalmars-d-learn mailing list