Finally taking the plunge to learn a Lisp dialect (Scheme), I have encountered two definitions of a list –
"Either the empty list or a pair whose cdr is a list".
"A collection of S-Expressions enclosed by parentheses".
Are these definitions equivalent?
They’re as equivalent as
{'a','b','c'}and"abc"The former is the machine’s logical representation of a list, the latter is how you represent it in your code.
And in scheme, you can pretty much treat everything as a list 🙂 (Someone’s going to downvote me for that, but I found it to be true when trying to think scheme-esque.)