What is the difference between Lisp -1 and Lisp -2?

I tried to understand the difference between Lisp -1 and Lisp -2 and how this relates to Clojure, but I still do not understand correctly. Can anyone enlighten me?

+76
lisp clojure lisp-2
Jan 2 '10 at 13:30
source share
2 answers

According to wikipedia :

Whether a separate namespace for functions is an advantage is a source of controversy in the Lisp community. This is commonly called the Lisp -1 and Lisp -2 discussions. Lisp -1 refers to the schema model, and Lisp -2 refers to the general Lisp model.

This mainly concerns whether variables and functions can have the same name without collision. Clojure is Lisp -1 , which means that it does not allow you to use the same name for a function and variable at the same time.

+50
Jan 02 '10 at
source share

You may like this paper by Richard Gabriel. This is a summary of the issues discussed by the Lisp community in Lisp1 vs Lisp2. This is a bit dense and slow movement in the first few sections, but much easier to read by the time you finish section 5.

Basically, Lisp1 has a single environment that maps characters to values, and these values ​​can be either "regular" or functions. Lisp2 has (at least) two namespaces (characters have a slot for their function value and one for a regular value). So, in Lisp2, you can have a function named foo and a value named foo, while in Lisp1, the name foo can refer to only one value (function or otherwise).

There are several tradeoffs and taste differences between them, but read the article for details. Christian Quinnes' book β€œLisp in Little Pieces” also discusses the differences woven in the text.

+59
Jan 02 '10 at 17:43
source share



All Articles