A very (very) basic scheme interpreter. Originally adapted from Peter Norvig's tutorial, have used the BiwaScheme Interpreter found at as my reference implementation.> (define fact (lambda (n) (if (<= n 1) 1 (* n (fact (- n 1))))))> (fact 2)
2> (fact 8)
40320> (define a 4)> (* a (+ a (* a a)))

Example Usage

Currently there are two ways to interact with pyscheme.

Command Line

The first is via the command line interpreter "":

pyscheme$ python>

An extremely sophisticated Ctr-D or Ctr-C exit mechanism has been implemented ;-)

File evaluation

For evaluating lisp files just pass the filename as an argument:

pyscheme$ python lisp/cond.s


The tests document the features I've implemented and can be run with:

pyscheme$ python -m test.test_lib

Wish List

  • Add unit tests that execute a more complex lisp program.
  • Implement verbosity command line flag
  • Fix my parser to deal with "multi part strings"
  • Implement "let"
  • Implement the define-syntax
  • Proper tear down for each test that resets the namespace and flushes stdout and stdin.
  • ...get the interpreter through the PyPy translator.


During development I've been using Python2.7 and PyPy 1.9.