← Back to context

Comment by floxy

11 hours ago

> (syntax-rules ...) The very first time I tried to use it, I ran into its limitations

syntax-case is the general purpose construct to use. syntax-rules is a restricted, easy-things-should-be-easy construct.

https://www.scheme.com/tspl2d/syntax.html

You don't need syntax case to do advanced things though. Alex shinn's match.scm uses all the dirty syntax-rules trick.

It is pretty awful to write things like that.

It's just not good because you need to work around its limitations, whatever its purpose is. Not good for prototyping because it's the red tape you need to cut to get work done. Red tape isn't, in general, a bad thing, but when it comes to prototyping it is.

  • I think most people misunderstood syntax rules. It was not meant as the macro system for scheme. It was meant as the template macro system everyone could agree on, while leaving the more powerful low level macro systems to the implementations. Syntax case, or explicit/implicit renaming or syntactic closures or what have you.