# (An ((Even Better) Lisp) Interpreter (in Python))

DevFeed: [(An ((Even Better) Lisp) Interpreter (in Python))](<https://devfeed.tech/articles/an-even-better-lisp-interpreter-in-python-40573.md>)

Original publisher: [Read original article](<http://norvig.com/lispy2.html>)

Published: 2010-10-05T00:00:00Z

Content type: article

Language: en

Sources: [Peter Norvig](<https://devfeed.tech/sources/peter-norvig.md>)

Topics: [Lisp](<https://devfeed.tech/topics/lisp.md>), [scheme](<https://devfeed.tech/topics/scheme.md>), [Python](<https://devfeed.tech/topics/python.md>), [Parser](<https://devfeed.tech/topics/parser.md>), [Closure](<https://devfeed.tech/topics/closure.md>), [Functional programming](<https://devfeed.tech/topics/functional-programming.md>), [Regular expression](<https://devfeed.tech/topics/regular-expression.md>)

Tags: [interpreter](<https://devfeed.tech/tags/interpreter.md>), [lisp](<https://devfeed.tech/tags/lisp.md>), [python](<https://devfeed.tech/tags/python.md>)

## AI overview

The excerpt presents an improved Python implementation of a Scheme-like Lisp interpreter. It adds stream-based input so expressions can span lines and a REPL that recovers from errors. Parsing now checks special forms, expands macros and quasiquote, and supports shorthand procedure definitions, optional `if` alternatives, and variadic lambda arguments. Its evaluator uses a loop for tail-position evaluation, allowing arbitrarily deep tail recursion without exhausting the Python call stack, though procedures may need restructuring into tail-recursive form. The excerpt also implements `call/cc` as a non-local escape, while explicitly noting it lacks Scheme's ability to save and invoke continuations repeatedly. Included examples and test output report 0 failures out of 81 tests for `lispy.py`.

## Source excerpt

A new version of Lispy (Lisp interpreter in Python). I released an earlier version on Sept. 30th, but this version is improved.