Hello.
Relatively often I happen to write
(unless x (setf x y))
or
(setf x (or x y))
and I want to replace this with a macro ENSURE as
(ensure x y)
Since the macro
(defmacro ensure (x y)
`(setf ,x (or ,x ,y)))
has problems with multiple evaluation (e.g. (ensure (aref x (incf i)) 1)),
the best solution should be something like
(define-modify-macro ensure (&rest args) or)
Question 1: Is this allowed by the spec, i.e. is the macro OR allowed to
appear at this place?
Question 2: Is this macro a good idea?
Question 3: Since such a macro might be rather common: is there another
name for it?
Thanks, Nicolas.