Ellipsis patterns and unquote-splicing Wolfgang Corcoran-Mathe (30 Dec 2023 02:06 UTC)
Re: Ellipsis patterns and unquote-splicing Wolfgang Corcoran-Mathe (30 Dec 2023 17:24 UTC)
Re: Ellipsis patterns and unquote-splicing Marc Nieper-Wißkirchen (13 Sep 2024 16:11 UTC)

Ellipsis patterns and unquote-splicing Wolfgang Corcoran-Mathe 30 Dec 2023 02:05 UTC

Hi again,

I noticed that the SRFI's Specification section says that "An
(⟨unquote-splicing [sic] ⟨expression⟩ …) form is equivalent to
(⟨unquote⟩ ⟨expression⟩ …) ⟨ellipsis⟩". This is not true, however,
when unquote-splicing occurs in a (⟨ellipsis⟩ ⟨template⟩) form,
i.e. when ellipses are escaped. At the very least, you can't
simply translate unquote-splicing to ellipsis patterns without
checking for escapes. To avoid possible implementation bugs, I think
"... except when the unquote-splicing form occurs as a sub-template
of a (⟨ellipsis⟩ ⟨template⟩) form," or something like that, should
be appended to the sentence quoted above.

There's a slightly annoying asymmetry between ellipsis patterns and
unquote-splicing. They do very similar things, but are different in
minor ways. The ellipsis identifier can be escaped in a template, but
there's no similar escape for unquote-splicing. While it's outside the
scope of this (finished) SRFI, I wonder whether another quasiquotation
form with ellipsis patterns and *without* unquote-splicing could be
more elegant. Of course, it wouldn't be as convenient. Food for
thought, I guess.

Regards,

Wolf

P.S. There's also a missing bracket after "unquote-splicing" in
the sentence about ellipsis/unquote-splicing equivalence.

--
Wolfgang Corcoran-Mathe  <xxxxxx@sigwinch.xyz>