static if - is the 'static' really needed?

Chris Cain clcain at uncg.edu
Fri Dec 13 12:03:29 PST 2013


On Friday, 13 December 2013 at 12:10:02 UTC, comco wrote:
> Imagine a world in which a simple 'if' has the semantics of a 
> static if, if the condition is evaluable at CT. Is this a world 
> you would rather live in?

They are fundamentally two different things. Eliding the 
difference is not a good idea. I'm with Jesse, I wish we had a 
"static foreach" because it's also a significant difference as 
well.

> "we don't need _static else_" -- why do we even need 'static' 
> in 'static if' by this reasoning?

Not exactly sure what the context of this is, but I suspect he 
was saying "we don't need _static else_" because we don't need it 
to resolve ambiguities in the AST (which is true). OTOH we would 
need 'static' in 'static if' to resolve the ambiguities in the 
semantics.


More information about the Digitalmars-d-learn mailing list