On Monday, October 11, 2021 at 11:38:20 AM UTC+2,
[email protected] wrote:
I sometimes find it convenient to be able to specify the "short-circuiting" of the "or" operator in the reverse order.
This happens in particular when I use the "and-let*" form, and I want to provide the default alternative:
Instead of
(or
(and-let* (...)
...)
default-value)
it might be preferable to write:
(otherwise default-value
(and-let* (...)
...))
where "otherwise" is defined trivially as
(define-syntax otherwise
(syntax-rules ()
((_) #false)
((_ expression) expression)
((_ expression . expressions)
(or (otherwise . expressions) expression))))
(so it effectively reverses the order of arguments to "or")
Do you think "otherwise" is a good name for this?
Or are there any alterantives that you'd recommend?
If the goal is to reverse `or`, why not write `(or c b a)` instead of `(or a b c)`?
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)