Turns out ancestors works on the class, not the instance:
> (ancestors ArithmeticException)
#{java.lang.Throwable java.io.Serializable java.lang.Exception
java.lang.RuntimeException java.lang.Object}> (ancestors (new ArithmeticException)) nil On Tue, Mar 7, 2017 at 7:05 PM <[email protected]> wrote: > This gives me nil: > > (try (/ 4 0) (catch Exception e (println (parents e)))) > > This too: > > (try (/ 4 0) (catch Exception e (println (ancestors e)))) > > This too: > > (try (/ 4 0) (catch ArithmeticException e (println (ancestors e)))) > > How is this possible? Shouldn't Exception be an ancestor? > > Or, more generally, shouldn't something be a parent? > > > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to [email protected] > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
