one-of?

swank.util

  • (one-of? val & possible)
Short circuiting value comparison.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source swank/util.clj:5 top

(defmacro one-of?
  "Short circuiting value comparison."
  ([val & possible]
     (let [v (gensym)]
       `(let [~v ~val]
          (or ~@(map (fn [p] `(= ~v ~p)) possible))))))
Vars in swank.util/one-of?: defmacro fn let map val = apply concat list or seq vector
Used in 0 other vars

Comments top

No comments for one-of?. Log in to add a comment.