Re: merge, not just for maps?

2009-01-24 Thread e
from my background, you can only go by what people promise. The interface promises it will work with maps. using anything else is undefined behavior. So I am wrong to assume anything about sort, also, under the same argument. it like this : http://www.fallacyfiles.org/afthecon.html you can onl

Re: merge, not just for maps?

2009-01-24 Thread rzeze...@gmail.com
I understand that merge uses conj, but my point remains. I, and I would imagine at least a few others in the programming world, view an API's documentation as it's contract with the rest of the world. In general it tells me what the function expects from me, and what I should expect from the fun

Re: merge, not just for maps?

2009-01-24 Thread wubbie
In core.clj, merge is essentially defined using conj. user=> (merge '(1) 2) (2 1) user=> (merge [1] 2) [1 2] user=> (merge #{1} 2) #{1 2} user=> (conj '(1) 2) (2 1) user=> (conj [1] 2) [1 2] user=> (conj #{1} 2) #{1 2} user=> (conj {:name "ryan"} {:age 25}) {:age 25, :name "ryan"} -sun On Jan

Re: merge, not just for maps?

2009-01-24 Thread e
merge confused me, too. I was surprised to see in the docs that its input needn't be sorted (or have anything to do with lists) . . . .or maybe it merges unsorted things however, but where's the discussion of whether the result of merging two sorted list is a sorted list? Well, it's avoided beca

merge, not just for maps?

2009-01-23 Thread rzeze...@gmail.com
user=> (doc merge) - clojure.core/merge ([& maps]) Returns a map that consists of the rest of the maps conj-ed onto the first. If a key occurs in more than one map, the mapping from the latter (left-to-right) will be the mapping in the result. nil According to merg