[plt-scheme] How to use syntax case?
>> I'm starting with syntax case from zero. My end goal is to read a file
>> and extract a definition by name, for example "define impl1" so that I
>> can include it in another document.
Hi Grant,
DivaScheme does a little bit of this, although it's not too documented.
http://planet.plt-scheme.org/package-source/divascheme/divascheme.plt/1/1/stags-lib.ss
The function "find-defs-in-stx" and all its helper functions use
syntax-case* to pick out the definition identifiers. You may be able to
look at it for some inspiration.
The Scheme Cookbook had a few good pointers to syntax-rules/syntax-case
stuff that is also helpful:
http://schemecookbook.org/view/Cookbook/GettingStartedMacros
Good luck!