Syntactic closures
justinethier opened this issue · 5 comments
These are required if we want to migrate Chibi's syntax-case
system to Cyclone.
For background see:
https://people.csail.mit.edu/jaffer/slib/Syntactic-Closures.html
https://github.com/justinethier/cyclone/blob/master/docs/research-papers/syntactic-closures.pdf
http://community.schemewiki.org/?syntactic-closures
The following will need to be supported: identifier?
, identifier->symbol
, identifier=?
, make-syntactic-closure
and strip-syntactic-closures
.
Also, what integration must be provided WRT ER macros? Can we define a macro using ER and then call, EG, identifier=?
?
The syntax-case implementation I wrote for Chibi is not a fully correct implementation as syntax-case is more expressive than either ER or SC. Unless I had wanted to replace the core of Chibi, I couldn't do better.
But it certainly doesn't make sense to implement syntactic closures just to port my approximate implementation of syntax-case. A much better solution for Cyclone would be to fully support syntax-case. You can use my Unsyntax expander for that.
@mnieper Interesting, does Unsyntax provide an R7RS implementation of syntax-case? How hard would it be to extract/reuse those parts?
Unsyntax is written in portable R7RS. What it currently does is provide a compiler and REPL from R7RS+syntax-case+syntactic extensions to a very basic R7RS subset. It is packaged as a frontend that runs on a host Scheme. I used Chibi for its development and that's what is currently used as a host. If Cyclone's R7RS's implementation is sufficiently faithful, it should be no problem to replace Chibi with a Cyclone backend.
Just extracting the syntax-case implementation from Unsyntax would be more work. In some sense, it makes sense that Unsyntax is monolithic as an expander because the macro system and the module system are inherently interwoven in R6RS and R7RS.
No plans to support syntactic closures. Closing.