[ANNOUNCE] PyScheme 1.5 release

Discussion in 'Python' started by Daniel Yoo, Sep 8, 2004.

  1. Daniel Yoo

    Daniel Yoo Guest

    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!
     
    Daniel Yoo, Sep 8, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bdeck
    Replies:
    0
    Views:
    410
    bdeck
    Jul 25, 2003
  2. Andreas Otto
    Replies:
    0
    Views:
    309
    Andreas Otto
    Sep 25, 2009
  3. Andreas Otto
    Replies:
    0
    Views:
    365
    Andreas Otto
    Sep 25, 2009
  4. Andreas Otto
    Replies:
    0
    Views:
    371
    Andreas Otto
    Sep 25, 2009
  5. Andreas Otto
    Replies:
    34
    Views:
    1,049
    Dave Searles
    Oct 7, 2009
Loading...

Share This Page