Moving towards draft 3 and finalization Daphne Preston-Kendal (11 Oct 2025 10:01 UTC)
Re: Moving towards draft 3 and finalization Arthur A. Gleckler (11 Oct 2025 16:33 UTC)
Re: Moving towards draft 3 and finalization Daphne Preston-Kendal (21 Oct 2025 21:06 UTC)

Re: Moving towards draft 3 and finalization Daphne Preston-Kendal 21 Oct 2025 21:05 UTC

On 11 Oct 2025, at 18:33, Arthur A. Gleckler <xxxxxx@speechcode.com> wrote:

> These forms don't have examples in their respective sections, but there are examples later in the text.  That's okay, although you might link to the later examples if you decide not to include them directly.
>     • match
>     • match-lambda
>     • match-values
> These don't have examples:
>     • match-define
>     • match-define-values

Also match-let, match-let*, match-let-values, match-let*-values, match-letrec, and match-letrec*. Hmm.

I’ve added match-let and match-define examples and a fairly useless match-let* example to my local copy. The -values and -letrec[*] forms are considerably harder to think of realistic examples for.

Felix collected these examples of match-letrec* in Racket before when he was working on SRFI 204:
<https://github.com/scheme-requests-for-implementation/srfi-204/blob/master/ref/letrec-examples.md>
(Note: These examples are in Racket code, where this SRFI’s match-letrec* is called match-letrec, in line with R6RS letrec* being simply called letrec in Racket.)

Of them, the only one which I understand and which actually seems to ‘need’ match-letrec* is the penultimate one. But even then, what’s really going on is that there’s one matching pattern and later a recursive one that’s simply a variable, and it’s more convenient and readable to simply say (match-letrec (…) …) than (match-let (…) (letrec (…) …)).

I could simply include the example from the test suite: <https://codeberg.org/dpk/extensible-match/src/commit/af45c4bae13c1ee94ab24f607ea840a2d7520e22/extensible-match-test.sls#L1370>
This example is about as useless as the Scheme report example of letrec itself. I also don’t actually have a test case which combines the recursive nature of match-letrec* with its successive-binding nature …

match-define-values also as-yet lacks an example in my local copy, but I don’t expect it will be too hard to find one.

I’ll go GitHub Code Searching for examples of the -values forms.

Daphne