Top 5

Benji Smith dlanguage at benjismith.net
Thu Oct 9 06:07:19 PDT 2008


Gide Nwawudu wrote:
> 2) Finalise const/invariant stuff and change manifest const from
> 'enum' to 'define' (or whatever).
> 
> define {
> 	double PI = 3.14;
> 	string author = "Walter";
> }
> define enum Direction { North, South, East, West };

I've never quite understood what people are talking about when they 
refer to a "manifest" constant. What does that mean?

And why do we need any special keyword? What does the "define" keyword 
give you that an ordinary variable declaration doesn't? Why not just 
write the code from above like this:

   double PI = 3.14;
   string author = "Walter";
   enum Direction { North, South, East, West };

What am I missing here?

--benji



More information about the Digitalmars-d mailing list