diff --git a/articles/lisp.md b/articles/lisp.md index 33bbedd..d5c88d2 100644 --- a/articles/lisp.md +++ b/articles/lisp.md @@ -60,6 +60,23 @@ Creating lists: (list 20 "Lisp" '(1 2) 39) ``` +Of course, cons cells are not limited to just lists, they can be nested and represent trees. Just read any Lisp source code for proof, +you're seeing the source encoded in a tree, directly by using S-Expressions. But here is something more immediate: +```lisp +;; (20 * 2 + 16) / 30 * 5 +;; (cons '* (cons (cons '/ (cons (cons (cons '+ (cons '* (cons 20 2)) 16)) 30)) 5)) +;; +;; (*) +;; / \ +;; (/) 5 +;; / \ +;; (+) 30 +;; / \ +;; (*) 16 +;; / \ +;; 20 2 +``` + ## Lisp languages in use - [Scheme](scheme.md): created by the hackers Guy Steele and Gerald Sussman in 1975 at the MIT. - [Common Lisp](common_lisp.md): Big for Lisp standards (still better and smaller than "modern" languages), is also the most used Lisp today.