Open jcubic opened 3 years ago
Looks great! Let's include it.
IMHO we should favor hygienic macros like syntax-rules
and syntax-case
, since those are one of the unique features of Scheme and the RnRS standards don't have unhygienic macro systems. But in practice, many schemers also use define-macro
, so that's fine. It sounds reasonable to post define-macro
code, and rewrite it hygienically later if we have time.
This example should be possible to write using syntax-rules
by using Oleg's symbol??
hack, but I'm not completely sure.
There is SRFI-200 (Draft) for pattern matching but I have my own implementation, that I've created as an example for my Scheme implementation:
Here is the whole code, we can use this in cookbook, the code is not that long, but unfortunately, it uses lisp-macros I'm not sure if you can rewrite it with
syntax-rules
(or syntax-case)The license is MIT but I'm fine in releasing it for scheme cookbook in multiple licenses.
@lassik what do you think? Can we put lisp macros into cookbook or should we do only pure R7RS compatible code?