Am So., 14. Juni 2020 um 17:58 Uhr schrieb John Cowan <xxxxxx@ccil.org>:

If Eithers are used in the sense of value + flag (and not in the sense of
success vs failure), toggling the flag is a common operation in many
algorithms (think of red-black trees, etc.).

This does not generalize to the >2 case, however.
Yes, but this is not what this SRFI is about.

As the cost of exporting either-swap both under either-swap and
either-swap! is literally zero, I see little point in not including
it. :)

Per contra, I see no point in including a specialized variant of a specialized operation, whose likelihood of use is 1/epsilon^2.

That's also a valid point of view. :) (I am assuming that you mean epsilon^2, not epsilon^(-1).)

I agree with one epsilon (specialized variant), but not with the second epsilon factor (because swapping two sides is a common operation in many algorithms).

It's always possible to see my editor's draft at http://github.com/johnwcowan/srfi-189 (or whatever number).

Thanks.

If I cannot persuade you to change `maybe->list', could we at least
get an optional argument that defaults (if it really has to) to the
empty list, but which could be set to `#f' as well.

This is really a completely different protocol.  I have called it the "multitruth" protocol, but a better name is needed.

The `assume' is only for clarity; you can remove it without changing
the semantics. The point is that `stop?' has to be called n + 1 times
according to the `unfold' protocol when you generate something of
length n.

That makes sense only if `successor` is being called for its side effects only.

Indeed. The same goes for `stop?'. If you want to implement the `unfold' protocol, you have to include this as well.  Otherwise, we better drop the unfold altogether.

I don't mind if you call it `maybe-cond'. I thought that `maybe-case'
is better because it is really about a finite number of cases and not
arbitrary conditions.

I'm continuing to exclude it from this SRFI.  Maybe later (unless we get Nothing more).

As I will continue to lobby for `maybe-let*' as a version for `and-let*' that actually works with multiple values. ;)