My version of Peter Norvig's Scheme, but in Ruby, with tests.
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
README.rdoc

README.rdoc

My Lisp

Introduction

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.

Usage

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