Missing patterns Wolfgang Corcoran-Mathe (10 Jan 2024 18:20 UTC)
Re: Missing patterns Wolfgang Corcoran-Mathe (11 Jan 2024 22:58 UTC)

Missing patterns Wolfgang Corcoran-Mathe 10 Jan 2024 18:20 UTC

I now notice that the SRFI 241 pattern grammar has a surprisingly
restricted form for ellipsis list patterns. The sample implementation
supports

(⟨pattern⟩ ⟨ellipsis⟩ ⟨pattern⟩ … . ⟨pattern⟩),

but the SRFI only allows (⟨pattern⟩ ⟨ellipsis⟩ . ⟨pattern⟩).

I'm also not sure why the following syntax-rules-style patterns were
excluded from the SRFI's pattern language:

(⟨pattern⟩ … ⟨pattern⟩ ⟨ellipsis⟩ ⟨pattern⟩ …)
(⟨pattern⟩ … ⟨pattern⟩ ⟨ellipsis⟩ ⟨pattern⟩ … . ⟨pattern⟩)

It's especially glaring since
#(⟨pattern⟩ … ⟨pattern⟩ ⟨ellipsis⟩ ⟨pattern⟩ …) is a valid vector
pattern; stripping off the # yields an invalid list pattern.

At this point, I wonder whether the entire SRFI 241 pattern language
should be overhauled.

Regards, Wolf

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