Semantics of ^^, Version 3 (Final?)

Rainer Deyke rainerd at eldwood.com
Wed Dec 9 10:55:31 PST 2009


Don wrote:
> Rainer Deyke wrote:
>  One that may not survive future
>> evolution of the D language, and may not respected by other
>> implementations of the D language. 
> 
> I think you're confusing 'pure' with 'constant expression'. They are not
> the same thing.

No.

>  (I /should/ be removed.  Having
>> different rules for operators and functions unnecessarily complicates
>> the language.) 
> 
> Do you mean the fact that constant folding always happens for operators,
> but that CTFE doesn't happen automatically?

Yes.

>  Code that depends on this distinction is highly fragile.
>>  It should not be possible to write code that depends on this
>> distinction.
> 
> How can you write code that depends on this distinction?

Thinking about it again, this may not be as much of a problem as I have
been saying.  If -1 ^^ -1 works for compile-time constants, then
expanding the definition of compile-time constant is unlikely to break
any code.


-- 
Rainer Deyke - rainerd at eldwood.com



More information about the Digitalmars-d mailing list