"case" does constant-time dispatch using the hash codes of the test values. Since nil is Java null, it doesn't have a hash code, so "case" can't handle it.
I wouldn't call it a bug, but there is work to be done on extending "case" to edge cases like this. -S On Aug 30, 5:07 pm, Paul Mooser <taron...@gmail.com> wrote: > I was surprised today when using "nil" as the test value for one of > the clauses of the new 1.2 "case" statement that it results in an NPE. > Is this a bug, or intended behavior? -- 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