-
Couldn't load subscription status.
- Fork 19
Open
Labels
Clause 10Standard Clause 10: Expressions and assignmentStandard Clause 10: Expressions and assignment
Description
Currently one cannot write things like:
if (i < size(a) .and. a(i) == 0) ...Because the compiler is free to evaluate a(i) first even if i is out of bounds. This proposal is to introduce .andthen. and .orelse. operators which will allow the above code to be written as:
if (i < size(a) .andthen. a(i) == 0) ...An alternative proposal to this is conditional expressions (#12) which got rejected.
There is also an option to make .andthen. just .and., the argument pro is that it does not introduce any new syntax, but an argument against it is that it would change the current freedom for compilers to re-arrange logical expressions.
septcolor, aradi, marshallward, zjibben, e-kwsm and 4 more
Metadata
Metadata
Assignees
Labels
Clause 10Standard Clause 10: Expressions and assignmentStandard Clause 10: Expressions and assignment