3 ms·
List is confusing terminology. It's a tree. Sure, any node of a Lisp tree is implemented as a list of branches, but fundamentally we are talking about trees, st
by kqr 3y ago
List is confusing terminology. It's a tree. Sure, any node of a Lisp tree is implemented as a list of branches, but fundamentally we are talking about trees, still.
- zelphirkalt 3y agoWould you like to call them "TREEPs"?
- lispm 3y agoForemost, it's just nested lists and not a tree. We are talking about lists and atoms. We are then talking about list operations, like getting list elements, appending lists, reversing lists, listing things, nesting lists and atoms, mapping lists, matching lists, destructuring of lists, ... This is a list: (munich frankfurt dresden) This is a list of lists ((münchen :state Bavaria) (frankfurt :state hessen ) (dresden :state sachsen)) If we look at the level of conses and atoms, then we see a binary tree and operations: car, cdr, cons, ... Lisp is there a low-level language: lists are made of simpler building blocks: two-item nodes and atoms. This is a tree: ((a . (10 . nil)) . ((b . (20 . nil)) . nil)) The dot is an infix syntax element for a cons cell. Which as a nested list is shorter written as ((a 10) (b 20))