3 ms·
Defmacro is trivial to implement in syntax-case, but you are in for a world of pain if you want to use bindings across modules. In have an implementation of ta
by bjoli 2y ago
Defmacro is trivial to implement in syntax-case, but you are in for a world of pain if you want to use bindings across modules.
In have an implementation of tagbody for guile scheme somewhere, using delimited continuations. I have seen it for racket as well. There is an implementation of loop for racket, but it relies heavily on set! which will tank performance, since chez and racket (and many schemes) is pretty bad at not boxing mutable values.
I wrote this which is definitely not as powerful as loop, but definitely more powerful than rackets for loops: https://git.sr.ht/~bjoli/goof-loop https://git.sr.ht/~bjoli/goof-loop
- rmrfchik 2y agoDefmacro isn't hygienic, while syntax- is. Is there way to use arbitrary names in hygienic syntax- macros?
- shawn_w 2y agoIf you know the name ahead of time, syntax parameters[1] (if your scheme supports them) work well. syntax-case lets you break hygiene to insert new names in a controlled fashion (but has issues with names known ahead of time; see linked paper). Renaming macros do too, I believe. 1: http://scheme2011.ucombinator.org/papers/Barzilay2011.pdf http://scheme2011.ucombinator.org/papers/Barzilay2011.pdf
- bjoli 2y agosyntax-case can introduce arbitrary bindings using datum->syntax.