Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What was a reason to introduce dotted pair in LISP?

Tags:

list

lisp

Does anyone know what was the historical reason to introduce a dotted pair type to LISP while existing list type covers everything?

Also I am interested in this because dotted pairs often confuse me.

like image 550
bananov Avatar asked Dec 02 '11 15:12

bananov


2 Answers

Read McCarthy's 1960 paper, "Recursive Functions of Symbolic Expressions and Their Computation By Machine, Part I".

He starts by defining S-expressions. One of the rules is that if e1 is an S-expression and e2 is an S-expression, then < e1 . e2 >, the dotted pair, is also an S-expression.

A few lines later, he defines the list notation, as a shorthand for an expression built up of a chain of dotted pairs.

This was the paper that first defined what would eventually become LISP. It didn't become an actual programming language until Steve "Slug" Russell implemented the first interpreter.

like image 146
John R. Strohm Avatar answered Sep 21 '22 13:09

John R. Strohm


Existing cons type covers everything (list-related). Dotted-pair notation is merely syntax for a cons literal.

like image 43
JB. Avatar answered Sep 17 '22 13:09

JB.