News for hackers. Stuff that matters.
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.
Re:Fortran adds conditional expressions by gnufx on Thursday July 01, 2021 @05:12PM (#27704938)
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.

Re:Fortran adds conditional expressions by sfblah on Thursday July 01, 2021 @04:30PM (#27704377)
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.
Re:Fortran adds conditional expressions by jstanley on Thursday July 01, 2021 @04:40PM (#27704517)
Probably more like:

  $y>5 || die "y should be greater than 5";