[ANNOUNCE] PyScheme 1.5 release

Daniel Yoo dyoo at hkn.eecs.berkeley.edu
Wed Sep 8 03:11:49 CEST 2004


PyScheme is a small implementation of the Scheme programming language.
The 1.5 release can be found here:

    http://hkn.eecs.berkeley.edu/~dyoo/python/pyscheme/

PyScheme is in pure Python, and has been written (somewhat) careful to
try to avoid eating up too much of the stack, even if given unusual
input.


It provides some of the core features in Scheme:

###
>>> import pyscheme.scheme
>>> pyscheme.scheme.repl(pyscheme.scheme.AnalyzingInterpreter())
Welcome to PyScheme!  Type: (QUIT) to quit.

[PyScheme] >>> (define (map f l)                  
[......1)] >>>    (if (null? l)    
[......2)] >>>        '()
[......2)] >>>        (cons (f (car l))
[......3)] >>>              (map f (cdr l)))))
ok
[PyScheme] >>> (map (lambda (x) (* x x)) '(1 2 3 4 5 6 7 8 9 10))
(1 4 9 16 25 36 49 64 81 100)
###


And it also includes CALL/CC.  People can play around with
continuations in the comfort of the Python interpreter:

###
>>> from pyscheme.scheme import AnalyzingInterpreter
>>> interp = AnalyzingInterpreter()
>>> from pyscheme.parser import parse as p
>>> interp.eval(p("(define k '())"))
'ok'
>>> interp.eval(p("""
...     (+ 5 (call/cc (lambda (k1) (set! k k1) 0)))
... """))
5
>>> interp.eval(p("(k 7)"))
12
###


I'll be giving a small presentation about PyScheme in the next
Baypiggies meeting on Thursday, September 9th, and I'll put up the
notes of that presentation online, as soon as I'm done writing them.
*grin*


I hope this helps!


More information about the Python-announce-list mailing list