[NAME]
ALL.misc.comparison.enumsym

[TITLE]
Enum Symbols (C++,Ruby)

[DESCRIPTION]

Dao supports a data type that is roughly a combination of C++ enum and Ruby symbol 
types. Like in C++, enum symbol in Dao can be declared in the following way,
     
   1  enum Boolean { False, True }
     
And zero will be associated with False and one will be associated with True.

But unlike in C++, this will not add integer constants named False and True to the 
current namespace, so they have to be accessed in the following way,
     
   1  bl1 = Boolean::False
   2  bl2 = Boolean::True
     
To use False and True as integer constants as in C++, one may do, 
     
   1  use enum Boolean
   2  bl3 = True
     


However, the more convenient way to use this type is to use them as symbols. A symbol is
an identifier prefixed with a dollar symbol. A symbol is a like a "polymorphic" enum:it 
can be used freely without being fixed to a particular enum type, but its actually value
will depend on the type of the variable that holds it.

For example,
     
   1  enum EnumRF{ Real, False }
   2  
   3  A = $False
   4  
   5  B : Boolean = $False
   6  C : EnumRF  = $False
     
Here A will hold a free symbol $False with value zero. And B will hold a symbol $False 
of type Boolean with value zero. And C will hold a symbol $False of type EnumRF with 
value one.

The main difference between Dao enum symbol and C++ enum and Ruby symbol is this
polymophic behavior of Dao enum symbol.