Is this expected: (nth nil 10) => nil. The docs say that this should throw. And indeed, (nth [] 10) or (nth '() 10) throw. Documented on http://ask.clojure.org here: https://ask.clojure.org/index.php/15195/nth-nil-10-returns-nil-when-it-should-throw
Yes, this is expected. nth, like get or contains? has polymorphic behavior on nil. You could think of this as being outside the behavior described in the docstring because there are no bounds on nil.