Changes for clojure.core/flatten

tonsky on Tue, 03 Jul 2012
user=> (flatten [1 [2 3]])
(1 2 3)

user=> (flatten '(1 2 3))
(1 2 3)

user=> (flatten '(1 2 [3 (4 5)])) 
(1 2 3 4 5)

user=> (flatten nil)
()

; Attention with stuff which is not a sequence

user=> (flatten 5)
()

user=> (flatten {:name "Hubert" :age 23})
()

; Workaround for maps

user=> (flatten (seq {:name "Hubert" :age 23}))
(:name "Hubert" :age 23)
pkolloch on Sun, 03 Oct 2010
user=> (flatten [1 [2 3]])
[1 2 3]

user=> (flatten '(1 2 3))
(1 2 3)

user=> (flatten '(1 2 [3 (4 5)])) 
(1 2 3 4 5)

user=> (flatten nil)
()

; Attention with stuff which is not a sequence

user=> (flatten 5)
()

user=> (flatten {:name "Hubert" :age 23})
()

; Workaround for maps

user=> (flatten (seq {:name "Hubert" :age 23}))
(:name "Hubert" :age 23)
dakrone on Fri, 16 Jul 2010
user=> (flatten [1 [2 3]])
[1 2 3]

user=> (flatten '(1 2 3))
(1 2 3)

user=> (flatten '(1 2 [3 (4 5)])) 
(1 2 3 4 5)

user=> (flatten 5)
()

user=> (flatten nil)
()