A very very tiny EXCRUCIATINGLY SMALL (OK... maybe not THAT small: ~75 lines) interpreter for a minimal lisp dialect.
The fork won't hurt ya! Feel free to send a pull request.
Nothing, obviously.
MIT License.
>> (+ (* (/ 3 4) 100) 45)
120>> ((λ (x y) (+ x y)) 3 4)
7
>> ((lambda m m) 0)
0>> ((λ (x)
(cond ((% x 2) 'odd)
(else 'even)))
4)
'even>> (list 'one '2 3)
("a", "2", 3)>> (list "a "3)
("a", 3)>> (+ ((define a 3) (* 10 a)) 5)
35>> ((define pow
(lambda (x n)
(cond ((= n 1) x)
(else (* x (pow x (- n 1))))
)))
(pow 2 4))
16.0You can help by extending the libs.py to support more functions. Or optimize the interpreter.
