#((lambda (x) (if (eq x 'nothing-to-see-here) 'move-along 'go-ahead)) 'nothing-to-see-here)
Yes, another aborted lisp. This one based on Paul Graham's essay: "The roots of lisp" Wrote it and uploaded here
Instead of using classes and nice stuff, I just screwed up the
Objectclass to have
unholy methods like
cdr (any cxr, actually) and
As any mathematical thingy, it assumes you provide nice inputs (it goes into a satanic infinite loop of recursion if not).
I did this in an afternoon and didn't even write a parser, but you can use it like this:
[[lambda, [:x], [:cond, [[:eq, :x, [:quote, :nothing-to-see-here]], :move-along] [:t, [:quote, :go-ahead]]]] [:quote, :nothing-to-see-here]]._eval([ #you'd put the environment here... ])
Or something like that.
A scheme implementation of the same LISP (McCarthy's lisp) is also provided, although it was never tested.
It greatly differs from the latter in that it doesn't represent everything as an array in the environment, but instead uses ruby Objects. Also, the environment is preloaded with lots of math functions and some lisp functions you'd expect in scheme.
This one does have a REPL, just run
ruby norvig.rb and have fun.