[Scheme-reports] The SYNTAX-RULES macro phase error Andre van Tonder (03 May 2011 21:10 UTC)
Re: [Scheme-reports] The SYNTAX-RULES macro phase error Aaron W. Hsu (05 May 2011 03:01 UTC)
Re: [Scheme-reports] The SYNTAX-RULES macro phase error John Cowan (05 May 2011 08:08 UTC)

Re: [Scheme-reports] The SYNTAX-RULES macro phase error John Cowan 05 May 2011 08:08 UTC

Andre van Tonder scripsit:

>   (define-syntax my-syntax-rules
>     (syntax-rules ()
>       ((_ blah) (syntax-rules ..........)))
>
>   (define-syntax foo (my-syntax-rules ........)) ;; PHASE ERROR
>
> This kind of thing would just work in some Scheme implementations, but
> others would require MY-SYNTAX-RULES to be imported FOR EXPAND for the
> macro definition of FOO to work.

Is it clear that it's required to work at all?  IOW, is it clear that
macro calls are expanded in the body of a DEFINE-SYNTAX?  Given the
following:

    (define-syntax yow (syntax-rules () ((yow . bow) (syntax-rules . bow))))
    (define-syntax cow (yow () ((cow) 32)))

MIT Scheme, Guile, Kawa, SISC, Chibi, Chez, SCM, Ikarus, IronScheme,
Mosh all accept both lines and (cow) => 32.  But Racket, Gauche,
Chicken, Scheme48/scsh, Larceny, Ypsilon, STklos, Scheme 9 all complain
about bad syntax or undefined variables in the second line.

--
As you read this, I don't want you to feel      John Cowan
sorry for me, because, I believe everyone       cowan@ccil.org
will die someday.                               http://www.ccil.org/~cowan
        --From a Nigerian-type scam spam

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports