[Edu-sig] pyscheme

Seth David Schoen schoen@loyalty.org
Tue, 1 Jan 2002 19:17:24 -0800


Danny Yoo writes:

> Hi everyone,
> 
> I've been tinkering with Scheme and Python for a while now, and I've
> cooked up a translation of the interpreter from the textbook "The
> Structure and Interpretation of Computer Programs" into Python:
> 
>     http://hkn.eecs.berkeley.edu/~dyoo/python/pyscheme/
> 
> 
> If anyone wants to use the code, please feel free.  I hope this helps!

That's impressive.

I fed it the quine

((lambda (x) (list x (list (quote quote) x))) (quote (lambda (x) (list x (list (quote quote) x)))))

and was impressed that I got back "the same" expression.
Unfortunately, the notation is different, using Python lists and
Python quotation instead of Scheme lists and Scheme quotation.  The
result, since the interpreter won't accept Python lists as input, is
that you can't _actually_ write a program in a simple way which prints
itself out character-for-character.

What would it take to make output from your interpreter appear in
Scheme-style instead of Python-style?

-- 
Seth David Schoen <schoen@loyalty.org> | Reading is a right, not a feature!
     http://www.loyalty.org/~schoen/   |                 -- Kathryn Myronuk
     http://vitanuova.loyalty.org/     |