Skip to content

Instantly share code, notes, and snippets.

@kurohuku
Created September 8, 2010 00:41
Show Gist options
  • Save kurohuku/569394 to your computer and use it in GitHub Desktop.
Save kurohuku/569394 to your computer and use it in GitHub Desktop.
(defmacro switch-2 (val &body clauses)
(let ((break (gensym)))
`(macrolet ((break-switch ()
`(throw ',',break nil)))
(catch ',break
(case ,val
,@(maplist
#'(lambda (clauses)
`(,(caar clauses) ,@(mapcan #'cdr clauses)))
clauses))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment