3 ms·
One nice thing about lazy languages is you get the desired operator behavior for conditional operators, short-circuiting logical operators, etc “for free” witho
by wyager 5y ago
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.
- sfblah 5y agoI'm too lazy even to click and read it, but you mean stuff like: const x = y || 3; ?
- deleted 5y ago[deleted]
- jstanley 5y agoProbably more like: $y>5 || die "y should be greater than 5";
- thaumasiotes 5y agoThat would be a short-circuiting logical operator.
- gnufx 5y agoWell-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.