[plt-scheme] full-expanded syntax and internal definitions

From: Dave Herman (dherman at ccs.neu.edu)
Date: Sun Aug 5 13:40:12 EDT 2007

A few questions w.r.t. fully-expanded syntax:

1. Chapter 12 of the language manual gives the syntax for fully expanded 
expressions without reference to internal definitions. Does this mean 
that all "blocks" of internal definitions followed by expressions are 
compiled to expression forms?

2. If that's the case, i.e., there are no internal definitions in core 
syntax, why does the core syntax allow for "implicit" begins in the 
bodies of lambda, let-values, etc? Wouldn't it be simpler to expand e.g. 
(lambda formals e1 ... en) to (lambda formals (begin e1 ... en))? 
Without internal definitions I don't see how this might break 
equivalence, but I'm sure I'm overlooking something.

3. It appears that "fully-expanded" does not necessarily mean that all 
macro definitions are removed. Presumably this is because-- thanks to 
the presence of local-expand-- more macro expansion may occur on 
fully-expanded syntax?

4. I tried running local-expand on

     (lambda ()
       (define-syntax foo (syntax-rules () [(_) 42]))
       (define y 10)
       y)

and got a letrec-syntaxes+values body. But letrec-syntaxes+values is not 
listed as one of the core forms of fully-expanded syntax. Should it be?

Thanks,
Dave


Posted on the users mailing list.