Why only assertion violations? Daphne Preston-Kendal (24 Oct 2024 19:04 UTC)
Re: Why only assertion violations? Wolfgang Corcoran-Mathe (26 Oct 2024 16:25 UTC)
Re: Why only assertion violations? Marc Nieper-Wißkirchen (26 Oct 2024 16:30 UTC)
Re: Why only assertion violations? Wolfgang Corcoran-Mathe (28 Oct 2024 18:11 UTC)
Re: Why only assertion violations? Daphne Preston-Kendal (28 Oct 2024 18:14 UTC)
Re: Why only assertion violations? Marc Nieper-Wißkirchen (28 Oct 2024 18:32 UTC)
Re: Why only assertion violations? Wolfgang Corcoran-Mathe (29 Oct 2024 17:55 UTC)

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>