R7RS: Matching of literals in syntax-rules transformers and the REPL
From
=?UTF-8?Q?Marc_Nieper=2DWi=C3=9Fkir@21:1/5 to
All on Thu Aug 20 05:05:34 2020
The following is about an observation I just made:
The syntax-rules (and syntax-case) system allows identifiers that are to be matched literally. An identifier in the input matches a literal identifier if they are (in the language of R4RS and R6RS) free-identifier=?, which means that they have the same
lexical binding or the two identifiers are the same [symbolically] and both have no lexical binding.
The derived syntax exported by the standard libraries only matches against literal identifiers that are bound (to auxiliary syntax) like "else" or "=>".
In fact, and this is my observation, this is, for libraries, the only sensible way in the presence of a REPL. By 5.7 of the R7RS, implementations may provide an initial REPL environment that behaves as if all possible variables are bound to locations.
In such a REPL, an identifier will never match with a non-bound identifier of a macro definition outside of the REPL.
The upshot is that one should never rely on the matching just by name provided by unbound identifiers.
-- Marc
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)