Changes for clojure.core/when-let

Confusion on Mon, 16 Jul 2012
;; Very useful when working with sequences. Capturing the return value 
;; of `seq` brings a performance gain in subsequent `first`/`rest`/`next`
;; calls. Also the block is guarded by `nil` punning.

(defn drop-one
  [coll]
  (when-let [s (seq coll)]
    (rest s)))

user=> (drop-one [1 2 3])
(2 3)
user=> (drop-one [])
nil
zkim on Sun, 26 Sep 2010
;; Very useful when working with sequences. Capturing the retun value 
;; of `seq` brings a performance gain in subsequent `first`/`rest`/`next`
;; calls. Also the block is guarded by `nil` punning.

(defn drop-one
  [coll]
  (when-let [s (seq coll)]
    (rest s)))

user=> (drop-one [1 2 3])
(2 3)
user=> (drop-one [])
nil
kotarak on Wed, 11 Aug 2010
Very useful when working with sequences. Capturing the retun value of `seq` brings a performance gain in subsequent `first`/`rest`/`next` calls. Also the block is guarded by `nil` punning.


(defn drop-one
  [coll]
  (when-let [s (seq coll)]
    (rest s)))

user=> (drop-one [1 2 3])
(2 3)
user=> (drop-one [])
nil