chicken-janitors
[Top][All Lists]
Advanced

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

Re: [Chicken-janitors] #1306: The body of a syntax definer should be all


From: Chicken Trac
Subject: Re: [Chicken-janitors] #1306: The body of a syntax definer should be allowed to be a macro call
Date: Sun, 17 Jul 2016 11:06:38 -0000

#1306: The body of a syntax definer should be allowed to be a macro call
-------------------------+---------------------
  Reporter:  johnwcowan  |      Owner:
      Type:  defect      |     Status:  closed
  Priority:  major       |  Milestone:  someday
 Component:  unknown     |    Version:  4.11.0
Resolution:  invalid     |   Keywords:
-------------------------+---------------------
Changes (by sjamaan):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 I believe this to be incorrect: you are mixing phases. The definition of
 {{{foo}}} defines a macro that needs to be available when defining
 {{{quux}}}, which is syntax, so it needs to be defined in a higher/earlier
 phase (what's the correct term for this?) than {{{quux}}}.

 This works when you wrap the definition of {{{foo}}} in a {{{begin-for-
 syntax}}}, or if you put it in a separate module and import it for syntax:

 {{{
 #!scm
 (define (baz) 32)

 (begin-for-syntax
   (define-syntax foo
     (syntax-rules ()
       ((foo) (syntax-rules () ((bar) (baz)))))))

 (define-syntax quux (foo))

 (print (quux)) ; prints 32
 }}}

--
Ticket URL: <http://bugs.call-cc.org/ticket/1306#comment:1>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.

reply via email to

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