Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Scheme Interpreter in Ruby

branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

README.md

README

  • A Lisp (Scheme) interpreter in Ruby; includes a REPL.

  • Run directly

$ chmod a+x ./lispy.rb  
$ ./lispy.rb
>>> (+ 5 2)
7
  • Or use require
$ irb
ruby-1.9.2-p290 :001 > require './lispy.rb'
 => true 
ruby-1.9.2-p290 :002 > repl ">>> "
>>> (+ 39 3)
42
  • The interpreter supports basic Scheme syntax
>>> (define r 5)
5
>>> (* 40 r)
200
>>> (if (< 10 11) (+ 5 12) (* 19 20))
17
>>> (define area (lambda (r) (* 3.141592653 (* r r))))
#<Proc:0x007ff8588342a0@./lispy.rb:77 (lambda)>
>>> (area 51)
8171.282490453
Something went wrong with that request. Please try again.