4 ms·
The language looks generally good for its goal, except these two operators |/y / maximum &/y / minimum Those two characters have no connection wit
by pmontra 8y ago
The language looks generally good for its goal, except these two operators
|/y / maximum
&/y / minimum
Those two characters have no connection with the operation they stand for and seem to be randomly picked from the available symbols on the keyboard. Why not simply max y and min y, which anybody can read and understand?
- deleted 8y ago[deleted]
- i_don_t_know 8y agoAt least for boolean operations, | (or) can be thought of as the maximum of a vector of 0s (false) and 1s (true). Likewise, & (and) is the minimum of a vector of 0s (false) and 1s (true). But I don't know if that was the motivation / justification for naming these operators / functions.
- uryga 8y agoif you squint a bit, `x or y` returns the one that's greater, i.e. `0 or 1 == 1`; and `x and y` returns the one that's smaller, i.e. `0 and 1 == 0`. so min/max kind of are a generalization of and/or
- pfortuny 8y agoThose are “or”=max, “and”=min. They are use sometimes in Mathematics (I have used them) but with the “low angle” and “up angle”. Not too frequently though.
- lelf 8y agoParaphrasing fold[max] y # maximum fold[min] y # minimum Those two characters have no connection with the operation they stand for | — logical-or, min & — logical-and, max 0|1 1 1|42 42
- de_Selby 8y agoSure they do, in most C-like languages || is OR and && is AND. For OR, from 1 | 0 = 1 It's a small step to generalise to N | 0 = N (~max) and then N | N-1 = N (max) The same goes for &
- SifJar 8y agomax and min are also available as keywords in k7/shakti
- quadcore 8y agoNote that |/y is | (or) over y. Hence, max.