Macro: ESWITCH

Documentation

Like switch but signals an error if no clause succeds.

Source

(defmacro eswitch ((obj &key (test #'eql)) &body body)
  "Like switch but signals an error if no clause succeds."
  (rebinding (obj test)
    `(switch (,obj :test ,test)
       ,@body
       (t
        (error "Unmatched SWITCH. Testing against ~S with ~S."
               ,obj ,test)))))
Source Context