[alexandria-devel] Reviewing control-flow.lisp; RfC to add ECOND, CCOND.

Tobias C. Rittweiler tcr at freebits.de
Wed Jun 11 15:57:09 UTC 2008


As control-flow.lisp is being reviewed, I'd like to suggest the
incoporation of ECOND, and CCOND that do the obvious things.

An implementation for ECOND is appended.

  -T.

(defmacro econd (&body clauses)
  "ECOND works exactly like COND except if no test-form of the clauses
evaluates to true, an error is signalled."
  `(cond
     ,@(append clauses
	       (unless (loop for (clause-test . nil) in clauses
			     thereis (member clause-test '(t otherwise)))
		 `((t (error "ECOND -- fall through.")))))))




More information about the alexandria-devel mailing list