Open LB-- opened 9 years ago
I want to elaborate on this. The condition must be labeled and all code that accesses the conditional declarations must be in iff
statements with the same conditions. &&
should probably also be allowed, but how freeform should this become? I worry that unrestricted usage is no better than #if
in C.
In nearly all languages,
if
is scoped - that is, variables declared within its scope are inaccessible to the enclosing scope. Some languages have another kind of if statement which is unscoped, for instance the C#if
preprocessor directive.The unscoped
iff
statement will be identical to theif
statement except that it has no impact on scope. Both the scopedif
and unscopediff
may appear in any scope (e.g. not within a function scope), this is only really useful foriff
to make conditional declarations.