Probably so the list can be compared to anything and thus o may not implement Seqable, like: user=> (.equals '() nil) false
On Sep 1, 4:14 pm, Timothy Baldridge <tbaldri...@gmail.com> wrote: > While examining the Clojure source I came across this line in the > EmptyList class: > > public boolean equals(Object o) { > return (o instanceof Sequential || o instanceof List) && > RT.seq(o) == null; > } > > What's up with the RT.seq(o) == null? Why don't we do this instead: > > public boolean equals(Object o) { > return (o instanceof Sequential || o instanceof List) && o > instanceof Seqable && ((Seqable)o).seq(o) == null; > } > > I've seen RT used in other places as well, I guess I don't understand > why it's used here, or what it is at all.... > > Timothy > > -- > “One of the main causes of the fall of the Roman Empire was > that–lacking zero–they had no way to indicate successful termination > of their C programs.” > (Robert Firth) -- 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