toy scheme interpreter written in ocaml
This is the beginnings of a scheme interpreter written in OCaml.
Right now, it doesn't do much - basic arithmetic, and basic definitions.
Here are some valid things it will evaluate:
# (+ 1 2 3)
6
# (- 1.4 1)
0.4
# (/ 3 2)
1.5
# (def f (x) (* x x))
# (f 3)
9
# (def g (x y) (+ (f x) y))
# (g 2 3)
7
# (def k () 10)
# (f k)
100
# k
10
Quit using Ctrl-C.
It's been an experiment in writing interpreters (/compilers - it 'compiles' the code into
a stack of instructions/values, which it then runs).
to build it, you need ocamlfind and batteries, then 'make' should do it.
daniel patterson, http://dbpatterson.com, 2010