Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Ruby implementation of a lisp
Ruby Common Lisp
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
examples/website
lib
spec
stdlib
.gitignore
README
rakefile.rb

README

This is an simple LISP-interpreter witten in ruby. 
Given a Lisp Expression like this:

  (+ (* 3 4) 2)

The Lexer will produce:

  [:+ [:* 3 4] 2]

Ruby symbols are LISP atoms and arrays are lists.

The interpreter evals the whole list and executes the apply method
on the functions.

The build-in functions are the functions that are attached to the interpreter
class. To bootstrap the interpreter the Core and Math modules (of helper.rb)
are included in the interpreter class. This makes Ruby integration rather
simple. Just include your ruby modules in the interpreter.

Using the interpreter by using the classes:

	l = Lisp::Lexer.new
	p = Lisp::Parser.new
	l.tokenize("test.lisp", p)
	i = Lisp::Interpreter.new
	i.start p.node
	
Evaluate a file:

	i = Lisp::Interpreter.new
	i.import("my_lisp_file.lisp")
	
Or just start the command line interface with REPL (read eval print loop):

  ./bin/rlisp
Something went wrong with that request. Please try again.