It's < 256 LOC toy lisp. Nothing super-fancy. If you don't count unit tests and Guido's mm.py it's even < 128 LOC.
It's quite pythonic. When you write
evalin LISP it's just a big
cond. It translates directly to if/elif/elif/... which doesn't look good. I used dict of functions instead, which looks better in my eyes. Uses as many Python features as possible. Python functions, python lists. etc.
Talking about Python and lisp lists:
def __init__(self, lst):
self.lst = lst
result = self.lst.car
self.lst = self.lst.cdr
else: raise StopIteration
def __init__(self, a, b=None):
self.car = a
self.cdr = b
return '(%s)' % ' '.join(str(elem) for elem in self)
list_123 = slist(1, slist(2, slist(3)))
a, b, c = list_123
Yes, this is just a linked list, not a true scheme cons, since it doesn't support improper lists, I posted it just to show how Python iterators are neat.