Lisp Lists and Cons Cells
Discussions center on Lisp's traditional cons cell-based lists versus array or vector implementations in dialects like Clojure, including debates on car/cdr vs first/rest functions, syntax like dotted pairs, and related abstractions.
Activity Over Time
Top Contributors
Keywords
Sample Comments
That would be surprising. Typically Lisp implements lists in terms of cons cells and the empty list.
Boah, Lisp has FIRST, SECOND, THIRD, .. REST since decades.
Doesn't SICP stress closures more than lists? (And this list-heavy approach only really works in a dynamically typed language.)
Not s-expressions in the traditional Lisp definition of singly linked lists. In Lisp (a . b) is a cons cell with two symbols a and b. In Clojure it is some complex data structure with three elements a, ., and b.
Would dotted pair notation make sense for this lisp where lists are arrays, not linked cons cells?
Reminder that lisps are FP too.
So it's the equivalent of Lisp's cons then?
No one uses lists in a LISt Processing language. :P
It's not uncommon in the Lisp-family that you can use [] as well as () so that problem of yours is solved already.
This particular case is unique to Clojure, I believe. You definitely canβt do that in Common Lisp , and Scheme I am not so sure. It was one of the main motivations for Rich Hickey to make the language more uniform so that a few functions work on any number of data structures.