On Feb 28, 2009, at 5:45 PM, Mark Engelberg wrote:
>
> As Rich explained in one post, in Lisp-like languages, there is a
> certain amount of intertwining between two views of a sequence which
> is a series of linked nodes. One way is to think about these nodes as
> just nodes with a first and rest. Another way is to think about each
> node as representing an entire chain from this node onward to the end.
> He explained that next is more like the "move from one node to
> another" view, and rest is more like the view of these things as
> collections, where rest gives you the collection of everything but the
> first.
>
> (rest []) translates in my mind to "everything but the first item of
> []". There is no first item of [], and there isn't an
> everything-but-the-first-item of it. It's empty. You can't take
> something out of it.
>
One way to think of it is as the sequence version of:
;a set of the things other than first
(disj #{} first) => #{}
;a sequence of the things other than first
(rest ()) => ()
i.e. it's an empty container of a particular type.
Rich
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---