Skip to content

Instantly share code, notes, and snippets.

@borkdude
Created April 15, 2011 11:38
Show Gist options
  • Save borkdude/921568 to your computer and use it in GitHub Desktop.
Save borkdude/921568 to your computer and use it in GitHub Desktop.
(defn guard [pred & args]
(if (apply pred args) args nil))
(def guard-> (partial guard >))
(guard-> 6 5) ; => (6 5)
(guard-> 5 6) ; => nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment