...do not require abandoning CAR and CDR, I think. See all other lisps having vectors, hashmaps, etc. Perhaps you're talking for code representation ? But I don't think that true for all 'traditional' lisps either. Also, there's been some innovation regarding lists: https://docs.racket-lang.org/reference/treelist.html
Would you explain further?
That's not true. Both CL and Scheme have other data structures besides cons cells, and that's been true for the Lisp family of languages for nearly 70 years now.
This bizarre belief that everything is a cons cell in Lisp and Scheme needs to go away.
Thanks for the sarcasm! Very productive and good-natured of you.
For your reference:
LISP 1.5 manual: https://www.softwarepreservation.org/projects/LISP/book/LISP...
Arrays were present in 1960. Admittedly, not much else but clear evidence that even then it wasn't just cons cells.
https://www.lispworks.com/documentation/HyperSpec/Front/Cont... - Common Lisp Hyper Spec which describes data structures other than lists and cons cells.
C-f that PDF for "array". For the other manual, I linked the TOC. It's right there on the page (arrays and hash tables, and you can follow up with structures and objects) and there's no reason to read the entire manual. I figured most people knew how to use a table of contents, I apologize if I expected too much from you.
https://www.softwarepreservation.org/projects/LISP/MIT/nnnfl...
LOOPS, from about the same time.
https://interlisp.org/documentation/2024-loops-book-1.pdf
More general discussion in a OOPSLA contribution from 1986.
https://web.archive.org/web/20220817140051/https://interlisp...
The 1988 book about CLOS, the approach that was later accepted in ANSI Common Lisp.
https://doc.lagout.org/programmation/Lisp/Object-Oriented%20...
Linked lists are comically inefficient on modern hardware and naming two of your fundamental operations based on CPU instructions from a chip from the 60s is not what I would call good API design.
This is an amazing resource for getting started with learning C by making your own "programming language", independent of any Lisp conventions.
For me, the most 'lispy' aspect of 'making your own lisp' is prebaked by the author with their using their own prebuilt parser library 'mpc'. (I was unable to find a link to the source in the book, so https://github.com/orangeduck/mpc )
I was unable to find any instance of 'car' or 'cdr' or 'caddar' and their like, which I feel is the real 'build your own lisp' epiphany.
https://en.wikipedia.org/wiki/CAR_and_CDR
The parser is so widely, and wildly, useful that it is independent of notation style, for instance, lisp's nearly ubiquitous 'polish notation'. (or its variants, for instance, 'cambridge polish notation')
Perfect example:
Under 'Chapter 9: Reading Expressions':
> Don't Lisps use Cons cells?
> Other Lisps have a slightly different definition of what an S-Expression is. In most other Lisps S-Expressions are defined inductively as either an atom such as a symbol of number, or two other S-Expressions joined, or cons, together.
> This naturally leads to an implementation using linked lists, a different data structure to the one we are using. I choose to represent S-Expressions as a variable sized array in this book for the purposes of simplicity, but it is important to be aware that the official definition, and typical implementation are both subtly different.
https://www.buildyourownlisp.com/chapter9_s_expressions#Read...
This is an awesome educational resource.
I think I would promote it more broadly than "Build Your Own Lisp".