Re:Fortran adds conditional expressions
by wyager on Thursday July 01, 2021 @03:48PM
(#27703728)
One nice thing about lazy languages is you get the desired operator behavior for conditional operators, short-circuiting logical operators, etc “for free” without having to build it into the language.
[ Parent
| on HN ]
Well-disposed as I am towards laziness, you may well not want short-circuiting, depending on the application. I just re-wrote the C implementations of logical reductions using bitwise operators instead to && and || to get them vectorized -- avoiding "conditional in loop". (They're Fortran-callable.)
Incidentally, gfortran treats the reduction like C, which seems a deficiency as the standard allows it not to.
I'm too lazy even to click and read it, but you mean stuff like:
const x = y || 3;
?
Re:Fortran adds conditional expressions
by thaumasiotes on Thursday July 01, 2021 @04:40PM
(#27704526)
That would be a short-circuiting logical operator.