PhobosWatch: manifest => enum

Walter Bright newshound1 at digitalmars.com
Fri Dec 28 10:56:55 PST 2007


Janice Caron wrote:
> y is a /copy/ of x, and clearly it should be possible to make a copy
> of a const thing and have the copy be mutable.

That doesn't work for structs or classes.


> Head constness needs to
> be dropped here, exactly as it is dropped in template distinction in
> D2.008 (t!(int) is the same thing as t!(const(int)) unless special
> syntax is used).

The problem with head const is that to make the concept work, you also 
need the concept of tail const, and you also need to be able to 
separately manipulate head & tail const. That's how D's first cut at 
const worked, and it was a disaster.

Just for fun, how would we define a tail const member function?


> I don't see why any of this isn't possible. Maybe that's because I'm
> dumb and I'm missing something obvious, but I'm baffled as to what it
> is. And if I /haven't/ missed anything, then we don't need a new
> keyword /at all/ - be it enum, manifest, or anything else.

Believe me, we've been down this road for a year, trying all kinds of 
things. It doesn't work. We can get tantalizingly close to closing the 
circle, but cannot quite get there.



More information about the Digitalmars-d mailing list