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

Re: [Scheme-reports] The SYNTAX-RULES macro phase error



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@x
will die someday.                               http://www.ccil.org/~cowan
        --From a Nigerian-type scam spam

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