4 ms·
Agree. I'm writing Scheme R5RS in Kotlin (https://github.com/kovrik/scheme-in-kotlin https://github.com/kovrik/scheme-in-kotlin) and have implemented everythin
by kovrik 9y ago
Agree.
I'm writing Scheme R5RS in Kotlin (https://github.com/kovrik/scheme-in-kotlin https://github.com/kovrik/scheme-in-kotlin) and have implemented everything except macros (6).
Have no idea how to beat them.
- _sdegutis 9y agoJust think of them as defining functions that take s expressions in and spit s expressions out before “normal” runtime evaluation and which hence only see built in symbols.
- kovrik 9y agoYes, I get that (in general). But then there are things like hygiene, performance and some tricky edge-cases. And I couldn't find any standard (and simple) algorithm to implement macros (preferably written in something other than Scheme itself). Still trying to wrap my head around.
- UncleEntity 9y ago"This paper describes a modified form of Kohlbecker’s algo- rithm for reliably hygienic (capture-free) macro expansion in block-structured languages, where macros are source-to- source transformations specified using a high-level pattern language." http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.464.1336&rep=rep1&type=pdf http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.464...