articles/lisp.md: update
This commit is contained in:
parent
0c95c0b596
commit
3128873a75
1 changed files with 4 additions and 2 deletions
|
@ -12,8 +12,10 @@ by the program itself. This gives Lisp powerful metaprogramming capabilities thr
|
||||||
time. Therefore, Lisp source code directly represents the program as a tree without extra superfluous syntax
|
time. Therefore, Lisp source code directly represents the program as a tree without extra superfluous syntax
|
||||||
(as in mainstream [programming languages](programming_language.md)).
|
(as in mainstream [programming languages](programming_language.md)).
|
||||||
|
|
||||||
Lisp is built on primitives such as `cons`, `car`, `cdr`, `lambda`, `apply`, `eval` and others. Since it is based on the [lambda calculus](lambda_calculus.md)
|
A Lisp can be built on a basic set of primitives such as `cons`, `car`, `cdr`, `lambda`, `apply`, `eval`, `eq`, `quote` and others (as decribed in the
|
||||||
a Lisp could be built in terms of lambdas. For example, using Church encoding this is how `cons` cells could be implemented using only lambdas:
|
Lisp 1.5 manual).
|
||||||
|
Since it is based on the [lambda calculus](lambda_calculus.md) a Lisp could also be built in terms of lambdas.
|
||||||
|
For example, using Church encoding this is how `cons` cells could be implemented using only lambdas:
|
||||||
```scheme
|
```scheme
|
||||||
(define (cons x y) (lambda (z) (z x y)))
|
(define (cons x y) (lambda (z) (z x y)))
|
||||||
(define (car p) (p (lambda (x y) x)))
|
(define (car p) (p (lambda (x y) x)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue