When I got into Scheme, Oleg Kiselyov would occasionally post to Usenet comp.lang.scheme with some new discovery or insight, or neat software library that showed Scheme as a serious language rather than purely academic (e.g., SSAX).
If you're reading this paper, but haven't used Scheme much yet, three things to be aware of:
1. `syntax-rules` is nice, but there's much more powerful and easier to use constructs now, like `syntax-case` and Racket's `syntax-parse`.
2. When you see Oleg doing something like breaking `syntax-rules`, I think it's usually not like a pitfall of C or C++ that anyone could make inadvertently, and more like you probably have to be as knowledgeable and clever as Oleg to break it this way. It's more something to come back to, after you've already learned to use these very nice and powerful tools, so you can appreciate it, and not just get confused or scared.
> `syntax-rules` is nice, but there's much more powerful and easier to use constructs now, like `syntax-case` and Racket's `syntax-parse`.
`syntax-parse` is the best! I wrote up some notes [1] while trying to figure out the differences between `syntax-case` and `syntax-parse` a year ago. Not the best notes, but there are some examples.
Racket solves the hygiene problem well with scope sets: each identifier gets tagged with the set of scopes it appears in. There's a blog post [2] by Matthew Flatt of Racket fame describing how Racket's scope system works. Thanks to scope sets, I'm not sure this inadvertent variable capture would be a problem.
> There's a blog post by Matthew Flatt of Racket fame describing how Racket's scope system works.
For clarity, I would specify that Matthew is the lone conceiver and implementer of the original sets-of-scopes system, as evidenced by him being the only author on the corresponding paper "Binding as Sets of Scopes" (POPL '16, DOI: https://doi.org/10.1145/2914770.2837620). So the blog post isn't just "some well-known Racket guy explaining a Racket thing", but rather "the guy who invented the thing explaining the thing".
The paper has a corresponding talk as well: https://youtu.be/rs27lkgq3Og. (And, in fact, Matthew has given the talk on more than a few occasions at various venues, so there are other recordings available as well.)
Some things I learned from his website took me weeks to annotate and understand partially, some things, that are a short demo he probably had a crack on for an afternoon still can take days to actually properly understand. This guy's output is so impressive!
One might think this is just pointless, but I have actually seen (and written) macros using techniques by Oleg. Alex Shinn (of Chibi scheme fame) has mastered them all I think.
I used his CK macro intro/explanation to write a function contracts library. Really great how it manages a stack on the macro level to change the order of expansion and making macros more composable. Surely I would not have gone looking at the papers it is based on, so his page acted as a gateway for me.
I think there is something to sitting down to stare at a macro until you understand how it works. I remember the first time I understood how cut worked. It was a revelation that led me to writing more and more monstrous syntax-rules macros until I ended up with goof-loop[0], which is now sort of finished, but also has parts that are so hairy that I don't really dare make any large changes.
I guess that is what you get from starting with (chibi loop) and bolting on a lot of extra features.
"Seemingly" in the title of the article seems important (since the point seems to be to debunk, in the terminology of the abstract, "folklore notions of hygiene and referential transparency"); why was it stripped?
If you're reading this paper, but haven't used Scheme much yet, three things to be aware of:
1. `syntax-rules` is nice, but there's much more powerful and easier to use constructs now, like `syntax-case` and Racket's `syntax-parse`.
2. When you see Oleg doing something like breaking `syntax-rules`, I think it's usually not like a pitfall of C or C++ that anyone could make inadvertently, and more like you probably have to be as knowledgeable and clever as Oleg to break it this way. It's more something to come back to, after you've already learned to use these very nice and powerful tools, so you can appreciate it, and not just get confused or scared.
3. Some of Oleg's Scheme software has been repackaged to make it easier to use. For example: https://docs.racket-lang.org/sxml/ (Also, Oleg's SXML became a de facto standard for representing XML and HTML in Scheme, and some of us have tried to make other tools compatible: https://docs.racket-lang.org/sxml-intro/#%28part._.Tools%29 )