Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Ruby Common Lisp
Fetching latest commit…
Cannot retrieve the latest commit at this time.
|Failed to load latest commit information.|
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