Fork me on GitHub

(code "liquidz.uo")

てきとーに書いた。ハイライトさせたいな

(defmacro case [base-value & patterns]
 (cons
  'cond
  (fold (fn [[val & more] res]
         (concat res (list (if (= val :else) val `(= ~base-value ~val)) (first more)))) (
    (partition 2 patterns)))))

» Go page top

blog comments powered by Disqus