PhobosWatch: manifest => enum
Bruce Adams
tortoise_74 at yeah.who.co.uk
Fri Dec 28 04:43:54 PST 2007
On Fri, 28 Dec 2007 11:15:08 -0000, Walter Bright
<newshound1 at digitalmars.com> wrote:
>
>> BTW, I think it was Janice who suggested that the compiler should
>> know whether a constant needs to be manifest or not (depending on
>> whether its address is taken somewhere). This would remove the need
>> for a way to distinguish manifest constants explicitly. Any thoughts
>> on that?
>
> The reason this won't work is because:
> const int x = 3;
> will type x as const(int), not int. There needs to be a way to declare a
> constant of type int.
This doesn't make sense to me. Why would you ever want a constant that was
not const?
and particularly a manifest constant? The only way you can change a
manifest constant is
by changing the source code. Things don't come much more constant than
that.
The only conceivable reason I can think of is that there is a bug or
misfeature somewhere
where something needs to be type equal when in fact it needs only to be
type compatible.
More information about the Digitalmars-d
mailing list