Something Go and Scala syntax

Michel Fortin michel.fortin at michelf.com
Thu Dec 30 04:29:38 PST 2010


On 2010-12-30 05:55:13 -0500, bearophile <bearophileHUGS at lycos.com> said:

> void foo(immutable int y) {
>     immutable x = 5;
>     if (i > x) {
>         writeln(x);
>     }
>     if (i > x)
>         writeln(x);
> }

In this example, 'x' is a compile-time constant so you can use 'enum' 
if you want it to be shorter. :-)

-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/



More information about the Digitalmars-d mailing list