Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

R7RS in Gambit Scheme

branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time


An R7RS implementation on the top of gambit scheme, and largely influenced by chibi-scheme and riaxpander.

Currently a test suite(tests/r5rs-tests.scm) from chibi-scheme is fully passed with small modification.


  1. Hygienic Macro System (define-syntax, let-syntax, letrec-syntax)

    Implemented with syntactic-closure. syntax-rules is supported with an modified chibi's version.


  1. R7RS module system support.

  2. Error message improvement

    Currently only internal core forms have proper location information for erros. Should add these for macro expanding?

  3. Proper local variable naming

    All local variable will compiles into a form of "name.location-number", this could be improved.

  4. let-syntax, letrec-syntax lacks support for moving internal definition to proper location.

    (let ()
      (+ 1 2)
      (let-syntax ()
        (define x 100))

expanded to

    ((lambda ()
     (+ 1 2)
     (define x 100)

which will report ill placed define error.

Internal document

  1. Environment

    Mapping from Name to Denotation

  2. Denotation

    A variable or macro transformer.

  3. Name

    Alias or symbol

  4. Alias

    A syntactic closure which has a Name form.

Something went wrong with that request. Please try again.