Don’t evaluate more than once
A macro similar to OR
(defmacro or1 (a b)
`(if ,a ,a ,b))
What happens for: (or1 (print 1) (print 2))
(if (print 1) (print 1) (print 2))
To avoid multiple evaluation:
(defmacro or2 (a b)
`(let ((temp ,a))
(if temp temp ,b)))
Previous slide
Next slide
Back to first slide
View graphic version