Manifest constants - why not 'alias' ?

Janice Caron caron800 at googlemail.com
Fri Dec 7 00:59:47 PST 2007


Of all the suggestions so far, my favourite is actually the one
suggested by Paul Anderson: final.

    final x = 3;

with type deduction, or

    final int x = 3;

without. When grouped:

    final
    {
        version = 3.1;
        author = "Janice";
    }

in all cases, we are declaring compile-time constants which occupy
zero storage space at runtime - exactly what Walter is suggesting
using "enum" for right now. After all, "final" is already a reserved
word, so it's not like we'd be adding a new one.



More information about the Digitalmars-d mailing list