News for hackers. Stuff that matters.
Re:Fortran adds conditional expressions by zoomablemind on Thursday July 01, 2021 @05:17PM (#27704991)
Is the ternary conditional just for the syntactic ease or there are some performance reasons for this?

I understand there are conditional assignment instructions, though optimizer could likely choose these already. Also branching prediction may take care of such assignments as well.

Re:Fortran adds conditional expressions by pklausler on Thursday July 01, 2021 @06:42PM (#27705791)
Fortran has no means for preventing execution of subexpressions in a portable way. The standard allows a compiler to short-circuit .AND./.OR. and to evaluate only one of the first two arguments to a MERGE with a scalar condition, but it is not required and a programmer can’t depend on it. Rather than strengthen the guarantees of short-circuiting and non-evaluation of existing constructs (neither of which would have invalidated any portable code), the geniuses of J3 decided to add more syntax.