I do have a plan to implement syntax-case in Gauche in a long term.  Playing with some ideas
that would allow pattern matcher to be decoupled from syntax-case.  It'll take time, though.


On Mon, Oct 21, 2019 at 1:06 PM John Cowan <xxxxxx@ccil.org> wrote:


On Tue, Oct 22, 2019 at 3:38 AM Marc Nieper-Wißkirchen <xxxxxx@nieper-wisskirchen.de> wrote:

We cannot look into the future, but if R7RS-large becomes at least as
powerful in the macro department, we may even be able to make SRFI
177's syntax to be as nice as the existing native systems.

I think we can maximize the chance of getting syntax-case accepted in R7RS-large if we can get it ported to Chicken, MIT, and Gauche, the three major holdouts against it.  Without two out of three I don't think it'll fly; even if it passes legalistically, not being able to port to those platforms is a big barrier.

There's no way I can do this work myself, but I think it has to be done, presumably with concomitant modifications to the native explicit-renaming systems on those platforms.  MIT has syntactic-closures, which may be a better base; it should be straightforward to see if the Chibi version Just Works.  Did you have to patch Chibi to make your library work there?

IFirst of all, `define-syntax' has to accept transformers that are just
a procedure taking a single argument (the form that is to be
transformed). In this modified system, the original transformers like
`er-macro-transformer' become forms evaluated at compile time that
evaluate to such single argument procedures.

Chicken definitely cannot do this.  Although er- and ir-macro-transformer are procedures, they return opaque transformer objects that are not procedures, and (define-syntax foo (lambda ...)) fails with a dynamic type error "transformer expected but got procedure".

All of these changes/additions are not particularly hard to implement
in a working `er-macro-transformer' system. Except for psychological
reasons, I don't see a barrier.

The psychological when projected outwards becomes the political.



John Cowan          http://vrici.lojban.org/~cowan        xxxxxx@ccil.org
Evolutionary psychology is the theory that men are nothing but horn-dogs,
and that women only want them for their money.  --Susan McCarthy (adapted)