My scheme interpreter written in scala, to get a better understanding of the book Functional Programming in Scala, especially for the chapter 9 - Parser Combinators
git clone https://github.com/demonyangyue/SchemeInterpreter
cd SchemeInterpreter
sbt run
//the programme will pause and wait for user input
> (+ 1 (+ 1 1))
3
> (define (fact x) (if (= x 0) 1 (* x (fact (- x 1)))))
null
> (fact 10)
3628800
You can also put a collection of Scheme statements in a file, then evaluating them in a batch, for example:
sbt run < src/main/resources/input_file
sbt test
- Cover all the scheme interpreter statements
- More comprehensive error reporting