Re: Why only assertion violations? Wolfgang Corcoran-Mathe 29 Oct 2024 17:54 UTC

On 2024-10-26 18:29 +0200, Marc Nieper-Wißkirchen wrote:
> This does not preclude the addition of other convenience syntax or
> procedures handling other condition types in a tailored fashion.

At the moment this is a bit awkward, since you have to re-implement
something like ‘restartable’ with a different condition type. I’m
considering ways of making it easier to select condition types.

One approach is to add a ‘restart?’ field to the restarter type. This
is a predicate that is used to test the condition raised by the
triggering exception. If it’s true, the restarter is made available;
otherwise, it’s filtered out.

The restarter clause of ‘restarter-guard’ can be extended to support
this predicate:

    (restarter-guard foo
      (con ((return-zero)
            "Return zero."
            serious-condition?   ; only restart &serious conditions
            0))
      ...)

Is this worth it? Let me know what you think.

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