What am I missing here? Why is rand-nth throwing the oob exception
instead of returning nil as I'd expect by analogy to other routines.

$ clojure
Clojure 1.2.0
user=> (rand-nth [1 2 3])
2
user=> (rand-nth [])
java.lang.IndexOutOfBoundsException (NO_SOURCE_FILE:0)
user=> (get [1 2 3] 5)
nil
user=> (get [] 0)
nil


regards,

jarek

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to