reasoning behind nth and take-nth inconsistent parameter pos.

2014-01-03 Thread John Kida
(take-nth i coll) (nth coll i) or (nth coll i not-found) Why is one using the index as the first parameter and the other uses index as its second parameter..? Is there any good articles out there for clojure idioms that may explain some of these things? -- -- You received this message

Re: reasoning behind nth and take-nth inconsistent parameter pos.

2014-01-03 Thread Jozef Wagner
Hi, nth takes collection and returns item of that collection. In such cases, collection comes first. nth follows the semantics of first, second, get, ... take-nth takes collection and returns other collection. In such cases, collection comes last. take-nth follows the semantics of take, map,

reasoning behind nth and take-nth inconsistent parameter pos.

2014-01-03 Thread Alex Miller
Generally collection functions like conj, assoc, nth, get take the collection as the first arg and return a collection of the same type. The majority of the functions in the core lib are sequence functions working at a higher abstraction level - they take a seqable thing, call seq on it, and