Re: Configuring read and write for syntax extensions
Lassi Kortela 16 Aug 2020 12:26 UTC
Ideally we would have 1:1 correspondence between port syntax settings
and #! directives. Any setting could be represented by a #! directive
and vice versa.
This would make it easy to understand how to configure the lexical
syntax from Scheme, and how it relates to the directives.
However, since we have no precedent for this, many implementations
currently have their own slightly different syntax.
We could coin #! directives for them after the fact (e.g. #!gauche for
Gauche). However, if those implementations themselves don't recognize
the flags with their own names, the situation would be a bit embarrassing.
Anyway, as things stand, #! is always followed by an identifier. So the
Scheme representation of the port settings could simply be a list of
symbols that are currently enabled.
For paired ones (currently just #!fold-case and #!no-fold-case) one
could be translated into the other; if that setting has the default
value, the corresponding symbol could simply be missing from the list.