My goal here was to learn how Lisp works at a really low level. I'm planning to add the features you would expect from a Lisp (e.g. macros) very soon.
It's more Scheme influenced (but not at all RnRS compliant) and as of about half an hour ago has working define-syntax/syntax-rules style macros.
The code isn't as nice though ;). I just wanted to get it working so I could rewrite it in itself.
Your interpreter would be even more awesome if its interface was a file buffer instead of a toplevel. But so far, great work!
Apart from that, it works quite nicely (I was positively surprised you went for lexical scoping), but without macros, you can hardly say it's a Lisp, it's a language with Lispy syntax.
> without macros, you can hardly say it's a Lisp, it's a language with Lispy syntax.
These two things go together: many lisps have let as a macro that uses lambda internally.
> I was positively surprised you went for lexical scoping
Indeed; that makes for a much more usable language.
"Ken Tilton is an aquired taste - if you can ignore his inflammatory remarks his advice is usually good. When I first saw some (most!) of his posts I initially thought WTF! but think of him as someone with Tourettes Syndrome and just look at what he is saying not how he is saying it!"
There's a couple of fortune cookie files of quotes from him (collected by someone else, but you can find them on his blog), they do make for funny reading, but you can see how some of this would sting if the remarks were directed at you: http://smuglispweeny.blogspot.co.uk/2010/08/fortune-cookie-f...
Definitely recommended if you want a starting point for something similar and don't know where to begin.
There is a slight bug though. Since the position gets updated after the position is calculated, the displayed value is out of sync.
So entering
1
2
3
And then typing: UP (3), UP (2), DOWN (1)
Displays 1, rather than 3.
(def a 3)
3
a
null
a should be 3, not null.