Re: Why do Clojure collections have (seq) rather than supporting the ISeq interface directly?

2012-09-17 Thread Alex Dowad
Thanks, SS!!! -- 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

Why do Clojure collections have (seq) rather than supporting the ISeq interface directly?

2012-09-16 Thread Alex Dowad
...Just trying to understand the rationale between Clojure's design here. As I gradually get deeper into Clojure, I've been highly impressed by how well thought-out everything is, so I'm sure there is a very good reason for this one too. The question is: Why are Clojure's built-in collections

Re: Why do Clojure collections have (seq) rather than supporting the ISeq interface directly?

2012-09-16 Thread Stuart Sierra
Mostly efficiency. A Seq generally gives you access to `first` and `rest` in constant time. Vectors, to take one example, cannot give you `rest` efficiently, but a Seq backed by the vector can. Clojure lists are implemented as singly-linked lists, which do have first/rest pointers, so they