Changes for clojure.core/conj

s_prakash_joy on Wed, 03 Apr 2013
user=> (conj [1 2 3] 4)
[1 2 3 4]

user=> (conj '(1 2 3) 4)
(4 1 2 3)

user=> (conj ["a" "b" "c"] "d")
["a" "b" "c" "d"]

user=> (conj [1 2] 3 4)               
[1 2 3 4]

user=> (conj [[1 2] [3 4]] [5 6])       
[[1 2] [3 4] [5 6]]

;; Maps only take vectors of length exactly 2
user=> (conj {1 2, 3 4} [5 6])
{5 6, 1 2, 3 4}

user=> (conj {:firstname "John" :lastname "Doe"} {:age 25 :nationality "Chinese"})
{:nationality "Chinese", :age 25, :firstname "John", :lastname "Doe"}

;; conj on a set
user=> (conj #{1 3 4} 2)
#{1 2 3 4}

ElieLabeca on Wed, 04 Jul 2012
user=> (conj [1 2 3] 4)
[1 2 3 4]

user=> (conj '(1 2 3) 4)
(4 1 2 3)

user=> (conj ["a" "b" "c"] "d")
["a" "b" "c" "d"]

user=> (conj [1 2] 3 4)               
[1 2 3 4]

user=> (conj [[1 2] [3 4]] [5 6])       
[[1 2] [3 4] [5 6]]

;; Maps only take vectors of length exactly 2
user=> (conj {1 2, 3 4} [5 6])
{5 6, 1 2, 3 4}

user=> (conj {:firstname "John" :lastname "Doe"} {:age 25 :nationality "Chinese"})
{:nationality "Chinese", :age 25, :firstname "John", :lastname "Doe"}


ElieLabeca on Wed, 04 Jul 2012
user=> (conj [1 2 3] 4)
[1 2 3 4]

user=> (conj '(1 2 3) 4)
(4 1 2 3)

user=> (conj ["a" "b" "c"] "d")
["a" "b" "c" "d"]

user=> (conj [1 2] 3 4)               
[1 2 3 4]

user=> (conj [[1 2] [3 4]] [5 6])       
[[1 2] [3 4] [5 6]]

;; Maps only take vectors of length exactly 2
user=> (conj {1 2, 3 4} [5 6])
{5 6, 1 2, 3 4}

;; Map into map
user=> (conj {:firstname "John" :lastname "Doe"} {:age 25 :nationality "Chinese"})
{:nationality "Chinese", :age 25, :firstname "John", :lastname "Doe"}


Wilfred on Thu, 07 Jul 2011
user=> (conj [1 2 3] 4)
[1 2 3 4]

user=> (conj '(1 2 3) 4)
(4 1 2 3)

user=> (conj ["a" "b" "c"] "d")
["a" "b" "c" "d"]

user=> (conj [1 2] 3 4)               
[1 2 3 4]

user=> (conj [[1 2] [3 4]] [5 6])       
[[1 2] [3 4] [5 6]]

;; Maps only take vectors of length exactly 2
user=> (conj {1 2, 3 4} [5 6])
{5 6, 1 2, 3 4}
TimMc on Fri, 01 Apr 2011
user=> (conj [1 2 3] 4)
[1 2 3 4]

user=> (conj '(1 2 3) 4)
(4 1 2 3)

user=> (conj ["a" "b" "c"] "d")
["a" "b" "c" "d"]

user=> (conj ["a" "b" "c"] "d")
["a" "b" "c" "d"]

user=> (conj [1 2] 3 4)               
[1 2 3 4]

user=> (conj [[1 2] [3 4]] [5 6])       
[[1 2] [3 4] [5 6]]

;; Maps only take vectors of length exactly 2
user=> (conj {1 2, 3 4} [5 6])
{5 6, 1 2, 3 4}
Steve on Fri, 25 Mar 2011
user=> (conj [1 2 3] 4)
[1 2 3 4]

user=> (conj '(1 2 3) 4)
(4 1 2 3)

user=> (conj ["a" "b" "c"] "d")
["a" "b" "c" "d"]

user=> (conj ["a" "b" "c"] "d")
["a" "b" "c" "d"]

user=>(conj [1 2] 3 4)               
[1 2 3 4]

user=>(conj [[1 2] [3 4]] [5 6])       
[[1 2] [3 4] [5 6]]
zkim on Sun, 26 Sep 2010
user=> (conj [1 2 3] 4)
[1 2 3 4]

user=> (conj ["a" "b" "c"] "d")
["a" "b" "c" "d"]

user=> (conj ["a" "b" "c"] "d")
["a" "b" "c" "d"]

user=>(conj [1 2] 3 4)               
[1 2 3 4]

user=>(conj [[1 2] [3 4]] [5 6])       
[[1 2] [3 4] [5 6]]
MrHus on Sat, 17 Jul 2010
user=> (conj [1 2 3] 4)
[1 2 3 4]
user=> (conj ["a" "b" "c"] "d")
["a" "b" "c" "d"]
user=> (conj ["a" "b" "c"] "d")
["a" "b" "c" "d"]
user=>(conj [1 2] 3 4)               
[1 2 3 4]
user=>(conj [[1 2] [3 4]] [5 6])       
[[1 2] [3 4] [5 6]]