chicken-janitors
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-janitors] #618: bound variables get stripped incorrectly


From: Chicken Trac
Subject: Re: [Chicken-janitors] #618: bound variables get stripped incorrectly
Date: Thu, 23 Jun 2011 17:12:53 -0000

#618: bound variables get stripped incorrectly
-----------------------+----------------------------------------------------
  Reporter:  felix     |       Owner:  sjamaan            
      Type:  defect    |      Status:  new                
  Priority:  major     |   Milestone:  4.8.0              
 Component:  expander  |     Version:  4.7.x              
Resolution:            |    Keywords:  syntax strip-syntax
-----------------------+----------------------------------------------------
Description changed by felix:

Old description:

> Matthew Flatt reports:
>
> The following program prints a gensym in v4.7.0 and 4aaea216cc9887, but I
> think it should print the symbol 'x:
>
>  (define-syntax c
>    (syntax-rules ()
>      [(_)
>       (let ([x 10])
>         (let-syntax ([z (syntax-rules ()
>                           [(_) (quote x)])])
>           (write (z))
>           (newline)))]))
>
>  (c)
>
> I wrote the example because I'm suspicious of "compiler.scm" treating
> `##core#quote' and `##core#syntax` the same. Maybe `##sys#strip-syntax`
> in "expand.scm" is supposed to do different things in quote and syntax
> mode; the comment "if se is given, retain bound vars" in `##sys#strip-
> syntax` suggests that it had two modes at some point in the past.

New description:

 Matthew Flatt reports:

 The following program prints a gensym in v4.7.0 and 4aaea216cc9887, but I
 think it should print the symbol 'x:

 {{{
  (define-syntax c
    (syntax-rules ()
      [(_)
       (let ([x 10])
         (let-syntax ([z (syntax-rules ()
                           [(_) (quote x)])])
           (write (z))
           (newline)))]))

  (c)
 }}}

 I wrote the example because I'm suspicious of "compiler.scm" treating
 `##core#quote' and `##core#syntax` the same. Maybe `##sys#strip-syntax` in
 "expand.scm" is supposed to do different things in quote and syntax mode;
 the comment "if se is given, retain bound vars" in `##sys#strip-syntax`
 suggests that it had two modes at some point in the past.

--

-- 
Ticket URL: <http://bugs.call-cc.org/ticket/618#comment:1>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]