Here’s my (work in progress) interpretation of Peter Norvig’s Scheme. The language of implementation is Ruby, and I’m working in a TDD-style using TestUnit.
require 'lisp' # Define the environment. I provide a basic one. env = Env.new Env.add_globals(env) # Eval some lisp code code = '(define area (lambda (r) (* 3.141592653 (* r r))))' lisp_eval(parse(code), env) code = '(area 3)' lisp_eval(parse(code), env) #=> 28.274333877