On 2025-02-04 03:34, John Cowan wrote:
Hmm. Perhaps this should supersede the procedural interface rather than supplementing it?
On Tue, Feb 4, 2025, 5:08 AM Daphne Preston-Kendal <xxxxxx@nonceword.org> wrote:
We’ve talked elsewhere about convenience syntax for this before, but I think I now have worked out reasonable syntax for it.
SRFI 254 should add syntax called ephemeron-case:
(ephemeron-case <<expression>>
((<<key identifier>> . <<value identifier>>)
<<body>>)
(else <<body>>))
[
I'm with John on at least considering supersession, as I'm having difficulty imagining a situation where this would be insufficient. If such a case can be made, that's fine. Otherwise, I recommend withdrawing the procedural interface, but using it in the specification of this form.
At the risk of some bikeshedding, I'd suggest that this isn't really a case form, but an if-then-else form, which might yield a syntax like this:
(ephemeron-if <expression> (key value) <then-body> <else-body>)
or are there multiple cases? Also, I've removed the dot from the bindings argument, as that's more like the bindings in a let-form than like anything else I can imagine.
-- vincent