Re: An elegant implementation of if-all-let

2015-07-11 Thread Andy Fingerhut
Disclaimer: I do not make decisions on what gets into clojure.core. Here is a page that gives some reasons why most things don't get into clojure.core: http://dev.clojure.org/display/design/Why+Feature+X+Was+Declined More specifically on if-all-let and things like it, many people seem to disagree

An elegant implementation of if-all-let

2015-07-11 Thread crocket
(defmacro if-all-let [bindings then else] (reduce (fn [subform binding] `(if-let [~@binding] ~subform ~else)) then (reverse (partition 2 bindings I quoted the function from p259 of "Chas Emerick, Brian Carper, Christophe Grand-Clojure Programming-O'Reilly Media (2012)"