[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Scheme-reports] Question regarding interaction between new syntax-rules extensions

Peter Bex <Peter.Bex@x> writes:

> [...] what should happen when the underscore is chosen as the ellipsis
> identifier?

Intuitively I would expect it to work as ellipsis in that case, because
we're explicitly specifying that, whereas the default meaning is
implicit.  I can't see if draft 9 specifies anything about this, though.

> And what happens when mixing literals with ellipsis identifiers?

Draft 9 says:

"An <ellipsis> is the identifier specified in the second form of
syntax-rules, [...]"


"A subpattern followed by <ellipsis> can match zero or more elements of
the input, unless <ellipsis> appears in the <literal>s, in which case it
is matched as a literal."

This sounds to me like (syntax-rules foo (foo) ...) would match `foo'
literally, because first <ellipsis> is made to be `foo', and then an
<ellipsis> (a `foo') appears in the <literal>s.  I don't know if this is
the intended meaning; in any case it's a useless use-case(!), so in my
opinion, leaving it unspecified is as good as forcing it to be an error,
or making up another specific meaning for it.

Perhaps the formal semantics solve either or both issues; I personally
have a hard time reading those. :)

By the way, I wonder why we can't specify an alternative for the
underscore, while we can specify what to use as <ellipsis>.


Scheme-reports mailing list