Implementation of pure lisp.
(But already it's not 'pure'.pure has many optional functions.)
$ make
$ make test
$ ./test
$ ./pure
> 1
1
>
$ ./pure [filename]
$ echo "(print 1)" | ./pure
1
Implements the following Special Form.
- if
- quote
- lambda
- define
Implements the following functions.
- atom
- eq
- car
- cdr
- cons
- +
- -
- *
- /
- %
- <
- >
- <=
- >=
pure has adopted a conservative Mark & Sweep GC.
pure has adopted a lexical scope.
Implementation of [tak function](https://en.wikipedia.org/wiki/Tak_(function) is as follows:
(define tak (lambda (x y z)
(if (<= x y)
y
(tak
(tak (- x 1) y z)
(tak (- y 1) z x)
(tak (- z 1) x y)))))
(print (tak 10 5 0))
MIT