[plt-scheme] let-syntax bug

From: ()
Date: Wed Apr 7 19:13:55 EDT 2004

On Thu, 8 Apr 2004, Bradd W. Szonye wrote:

>     (let-syntax ((foo ...))
>       (define-syntax bar (syntax-rules () ((bar) 'hello))))
> 
> The syntactic binding of BAR is clearly nested inside FOO's region.
> Migrating BAR outside of the LET-SYNTAX region would clearly break
> syntactic scoping, which is IMO a very, very bad idea.

Except that "internal definitions" are already allowed in transformer
templates.   

In regular Scheme, the following

  (define f 
    (lambda () expr)

  (f)            

gives the same answer as 

  (letrec ((f (lambda () expr)))
    (f))         

In analogy, my expectation would therefore be that 

  (define-syntax f
   (syntax-rules ()
     ((f) expr))))

  (f)

should give the same as 

  (letrec-syntax ((f (syntax-rules () expr)))
    (f))

However, this is not the case when expr is an internal define-syntax.  






Posted on the users mailing list.