[plt-scheme] expand

From: Jos K oot (jos.koot at telefonica.net)
Date: Wed May 23 10:46:45 EDT 2007

In section 12.6.1  "Expanding Expressions to Primitive Syntax" of the fine "PLT Mzscheme Language Manual" the possible shapes of fully expanded expressions are shown. The display does not account for the lifting of  expressions within nested begin forms. Can I safely assume the following?

fully-expanded-expr is top-level-expr

top-level-expr is one of
  (#%expression expr)
  (module identifier name (#%plain-module-begin module-level-expr* ···)) <=== see below
  (begin top-level-expr ···)

module-level-expr is one of
  (provide provide-spec ...)

general-top-level-expr is one of
  (define-values (variable ···) expr)
  (define-syntaxes (identifier ···) expr)
  (define-values-for-syntax (variable ···) expr)
  (require require-spec ···)
  (require-for-syntax require-spec ···)
  (require-for-template require-spec ···)

expr is one of
  (lambda formals expr* ···1) <=== see below
  (case-lambda (formals expr* ···1) ···) <=== see below
  (if expr expr)
  (if expr expr expr)
  (begin expr* ···1)
  (begin0 expr expr* ···) <=== see below
  (let-values (((variable ···) expr) ···) expr* ···1) <=== see below
  (letrec-values (((variable ···) expr) ···) expr* ···1) <=== see below
  (set! variable expr)
  (quote datum)
  (quote-syntax datum)
  (with-continuation-mark expr expr expr)
  (#%app expr ···1)
  (#%datum . datum)
  (#%top . variable)
  (#%variable-reference variable)
  (#%variable-reference (#%top . variable))
top-level-expr* is any top-level-expr except (begin any ...)
module-level-expr* is any module-level-expr except (begin any ...)
expr* is any expr except (begin any ...)

The word 'except' is not nice, but without it, the description becomes unnecesary complicated/duplicated, I think.

Kind regards, Jos Koot

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20070523/e373e150/attachment.html>

Posted on the users mailing list.