Possible Duplicate:
How many primitives does it take to build a LISP machine? Ten, seven or five?
I am curious. What is the most minimal LISP, upon which all further features could be built? Ignore efficiency -- the question comes simply from a place of elegance.
If you awoke on an alien planet and were instructed to build the most minimal LISP that you could later build upon to implement any feature you liked, what would you include?
Edit: Clarification. My intent here is not to start a debate, rather I am considering implementing a minimal LISP and I want to understand how minimal I can go while still allowing the language I implement to be Turing complete, etc. If this turns out to be controversial I am sure I will learn what I wanted to learn from observing the controversy. :). Thanks!
Interdental lisp – Interdental lisp is the most common and well-known type of lisp. It is caused by the tongue pushing forward between the front teeth. In the case of an interdental lisp, the s or z sound is pronounced like “th”.
Courtesy of Paul Graham, here's a Common Lisp implementation of John McCarthy's original LISP:
It assumes quote,
atom
, eq
, cons
, car
, cdr
, and cond
, and defines null
, and
, not
, append
, list
, pair
, assoc
, eval
, evcon
and evlis
.
Peter Norvig implemented a LISP interpreter in 90 lines of Python, and his subsequent article discusses in detail what you're asking. Well worth the read, IMHO.
http://norvig.com/lispy.html
I've got a feeling that his "sequencing" special form could be dropped if only function calls could take an arbitrary number of parameters.
(defun last (lst)
(if (cdr lst)
(last (cdr lst))
(car lst)))
(defun begin (:rest y) (last y))
But this would complicate function application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With