Skip to content

heleifz/pyScm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PyScm

A Scheme Interpreter

PyScm is my toy project which implement a subset of Scheme programming language in Python. PyScm has the same structure of meta-circular interpreter in SICP.

import pyscm
code = """
(define (sum lst)
    (if (eq? lst '())
        0
        (+ (car lst) (sum (cdr lst)))))
(define (map f lst)
    (if (eq? lst '())
        '()
        (cons (f (car lst)) (map f (cdr lst)))))
(sum (map car '((1 2 3) (4 5 6))))
"""
ast = pyscm.parse(code)
print pyscm.evaluate(ast, pyscm.make_base())

Todo

  1. Implement Scheme to C transformation

About

A Scheme Interpreter implemented in Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages