lib/slmode.sl lacks keywords “orelse” and “andelse” (patch provided)
kseistrup opened this issue · comments
I noticed that the latest commit (68f0c75) doesn't have the keywords orelse
and andelse
in the lib/slmode.sl
file. The attached diff should mitigate that. I've thrown in abs
, too, because I use it every now and then.
🙏
The 'orelse' and 'andelse' keywords have been deprecated for quite a while in favor of […]
Thanks for letting me know. I actually started with ||
and &&
, but then I read …/doc/text/slang.txt
. To be fair, it does say (in sect 7.4) that:
As of S-Lang version 2.1, use of the andelse and orelse have beendeprecated in favor of the && and || short-circuiting operators.
but then it goes on to say
expressions of the form:
expr-1 and expr-2 and ... expr-n
can be replaced by the short circuited version using andelse:
so I got the impression that andelse
and orelse
were preferred. My fault that I didn't read the first sentence properly. I will revert the change. Thanks!