Hi Rob, have a look at http://clojure.org/sequences and then on that page there's a reference to http://clojure.org/lazy, which explains the evolution of the lazy/eager sequences. Next is used for eager cases (e.g loop/recur) and rest for lazy-seq. Should make sense if you check out those references.
Hth, Adrian. On Sun, Aug 9, 2009 at 5:41 PM, Rob<rob.nikan...@gmail.com> wrote: > > Hi all, > > I'm trying to understand the next vs rest functions. I don't see why > you want/need both. Is it because null is in the picture? It seems > like the interface to a good old lisp list is 3 functions (car/first/ > head, cdr/rest/tail, null?/empty?). I can imagine making this into an > abstract immutable sequence with a java interface like: > > public interface FunctionalListyThing > { > Object first(); > FunctionalListyThing rest(); > boolean isEmpty(); > } > > Why does one need the 4th method, "next()" ? > > thanks, > Rob > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---