(drop-while pred)
(drop-while pred coll)
Returns a lazy sequence of the items in coll starting from the
first item for which (pred item) returns logical false. Returns a
stateful transducer when no collection is provided.
Example
(do
["Remove all non-vowel characters up to the first vowel"]
(drop-while (complement #{\a \e \i \o \u}) "clojure"))
Source
(defn
drop-while
"Returns a lazy sequence of the items in coll starting from the\n first item for which (pred item) returns logical false. Returns a\n stateful transducer when no collection is provided."
([pred]
(fn
[rf]
(let
[da (volatile! true)]
(fn
([] (rf))
([result] (rf result))
([result input]
(let
[drop? @da]
(if
(and drop? (pred input))
result
(do (vreset! da nil) (rf result input)))))))))
([pred coll]
(let
[step
(fn
[pred coll]
(let
[s (seq coll)]
(if (and s (pred (first s))) (recur pred (rest s)) s)))]
(lazy-seq (step pred coll)))))