[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. Advertisements

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. Replies:
    0
    Views:
    508
  2. Stylus Studio
    Replies:
    0
    Views:
    445
    Stylus Studio
    Nov 15, 2005
  3. Stylus Studio
    Replies:
    0
    Views:
    467
    Stylus Studio
    Jun 13, 2006
  4. Art Haas
    Replies:
    0
    Views:
    344
    Art Haas
    Jul 29, 2003
  5. Andreas Otto
    Replies:
    0
    Views:
    462
    Andreas Otto
    Sep 25, 2009
  6. Andreas Otto
    Replies:
    0
    Views:
    550
    Andreas Otto
    Sep 25, 2009
  7. Andreas Otto
    Replies:
    0
    Views:
    533
    Andreas Otto
    Sep 25, 2009
  8. Andreas Otto
    Replies:
    34
    Views:
    1,399
    Dave Searles
    Oct 7, 2009
Loading...