On Thu, Jul 20, 2017 at 5:53 AM, Marc Nieper-Wißkirchen <xxxxxx@nieper-wisskirchen.de> wrote

So the question is: What does "appear in" means, e.g. whether it uses free-identifier=? or bound-identifier=? as the equality predicate of the set(oid) of <literal>s

R7RS further says: "An identifier appearing within a <pattern> can be an underscore (_), a literal identifier listed in the list of <literal>s, or the <ellipsis>. All other identifiers appearing within a <pattern> are pattern variables."

Again, "appear in" is used. And here it is clear that is must be "free-identifier=?", otherwise the underscore or the ellipsis would not be matched by their denotation. (Or "appear in" would suddenly change its meaning in the very same sentence, which is absurd.)

I would say that "X appears in Y" simply refers to the S-expression concept of X being some descendant element of Y. R7RS 4.3.2 also says "It is an error for the same pattern variable to appear more than once in a <pattern>. "  I think you agree that determining whether pattern variables are the "same" should be done using bound-identifier=?, so I think that kills your theory that the verb "appear" can only be used in connection with free-identifier=? comparisons.

So it appears that the question is not what "appears" means, but rather what the meaning of "be" be.  What does it mean for "an identifier appearing within a <pattern>" to "be an underscore" or "be ... a literal identifier listed in the list of <literal>s"?

R7RS 4.3.2 also requires us to identify "Identi fiers that appear in the template but [be] not pattern variables".

I would say that the rule of being that's most in accord with the concept of "lexical scope" is that when you're trying to determine whether an identifier's meaning has been changed by a declaration that's lexically present in the syntax-rules form (i.e., checking whether an identifier in a template has been declared a pattern variable by some identifier in the pattern, or checking whether an identifier in a pattern has been declared a literal by some identifier in the literals list), you use bound-identifier=?.  And when you're checking whether some free identifier (i.e., one not affected by any of the declarations in the syntax-rules form) should have some special meaning because (1) it's an identifier like _ or ... that was declared to be special in the definition of syntax-rules in the top-level environment, and (2) the environment of the syntax-rules form does not contain any shadowing binding of the identifier, then you use free-identifier=? to do the comparison.

-Al