I'd like some recommendations for tutorials on macros. syntax-rules for sure, but beyond that, er- and ir-transformers, or syntax-case, it's all up for grabs.

The motivation is to try to encourage colleagues to move beyond defmacro.

What I've collected so far:
"Fear of Macros" covering syntax-rules, syntax-case and parse-syntax

"Mini-tutorial on explicit (and implicit) renaming macros in CHICKEN"

An old and now out-of-date in parts post to chicken-users about macro systems covering sc-, rsc- and er-macro-transformer, and touches on syntax-case.

The blog post @erkin is working on, which looks like it'll be great.

Show thread

I'm writing a blogpost about the differences between Scheme macro models right now! Would you be interested in giving me C&C?

@erkin I sometimes program in strict C89 because that's fun and sufficient and the thought of portability support is cool. If I learned r5rs and say fuck off to 6 and 7, am I sealing my demise or is it as cool as C89?

@byllgrim R5RS is cool and good, and (mostly) forward compatible with R6RS and R7RS, but it's very limited in scope and you'll be relying on implementation-specific libraries for the most part.

@erkin @byllgrim If you can do what you need with R5RS, you'll be fine. It's really just the core language, though.

@erkin That sounds great, I'd love to read a draft or notes or whatever you have 👍

Here's a version annotated with feedback. Some about presentation, a few technical points. My comments are all bracketed by [[ and ]]

@tfb Much appreciated! I totally agree with your comments and I'll update the post accordingly.

@tfb I don't have tutorial but showing the definition of `define-syntax-rule` and how to use will prolly help. See

It really looks like defmacro to me.

@zig Yeah, I'm looking for a collection of things that are more accessible than specs, reference docs, or just code.

So far I have "Fear of Macros" and the Chicken user guide, which is remarkably accessible.

Indeed, that one is great 👍. It and Juergen Lorenz's tutorial on Chicken macros were what I had gathered by looking on my own.

@tfb Here's what I collected during my search for related works:

CHICKEN also has a wiki page for procedural macros in general:

Scheme Wikibook's section on macros is a tad dated but it comes with a decent comparison `define-macro` with `syntax-rules`.

JRM's primer on `syntax-rules` is *the* most comprehensive document on `syntax-rules` I've come across:

Sign in to participate in the conversation
Functional Café

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!