try-or, or-try, try-else or else-try?
I can’t decide which name is best for this macro:
(defmacro try-or
"Evaluates exprs one at a time, from left to right. If a form returns a
value, this value is returned. If a form throws an exception, the next
form is evaluated.
If the last form throws an exception, the exception isn't caught."
([] nil)
([form] form)
([form & forms]
`(try
~form
(catch Exception e#
(try-or ~@forms)))))
try-cond
No, never mind. try-or
why not ‘try-one ?
It most closely matches the existing function some. So maybe try-some?
grayswx: some is a function (plus it takes a predicate), or is a macro. I think try-or is better.
try-harder!