Re: syntax-case as a pattern matcher
Marc Nieper-WiÃkirchen 30 Jun 2020 17:49 UTC
Am Di., 30. Juni 2020 um 19:45 Uhr schrieb Panicz Maciej Godek
<xxxxxx@gmail.com>:
> wt., 30.06.2020, 15:03 użytkownik Marc Nieper-Wißkirchen <xxxxxx@nieper-wisskirchen.de> napisał:
>>
>> SRFI 200 claims that `syntax-case' cannot be applied outside macro
>> transformers.
>
>
> I think that's an interpretation stretched too far, or maybe unfortunate wording on my side.
>
> My intent is that syntax-rules/syntax-case are DSLs for writing macros, which is what they are optimized and intended for. Using them for different purposes would likely be considered an abuse.
When you want to match Scheme source code, it is certainly not an abuse.
> Yet outside of Oleg Kiselyov's show-off articles you don't see it being used in regular Scheme functions much, or do you?
It is used, for example, in the psyntax expander (used in Guile) and
in Chez Scheme's expander (which runs at phase 0).