Yeah multiple inheritance has its can of worms.  Gauche employs CLOS-style multiple inheritance, and typical compounding patterns conditions are handled with mixin inheritance.  To make it work, though, you have to design condition type hierarchy very carefully.  Compounding, on the other hand, can be very loose, but one can adapt it to various infrastructures (simple non-inheritance record system, single inheritance type system, or multi-inheritance system.)

I browsed John's compound objects.  It is simple but I'm afraid it gets too low-level to fit into implementation's existing type system, other than predicate-base type system.  E.g. Gauche's implementation of compound condition is an instance of <compound-condition> class, which is a subclass of <condition>, and I can use Gauche's type dispatch system to handle <condition> instances.   With the pre-srfi compound objects, all of the compound objects becomes an instance of a single class and any dispatch needs to be predicate based, totally bypassing the native object system.








On Fri, Aug 14, 2020 at 12:18 PM John Cowan <xxxxxx@ccil.org> wrote:
Compound conditions exist in R6RS because it does not have general multiple inheritance, which is what CL uses to give a condition object more than one type simultaneously.  It's pretty much a hack, but then again multiple inheritance is a nightmare.  Note that in R6RS simple conditions are record types, whereas in CL they may or may not be.

I instead generalized compound conditions to compound objects.  There's a pre-SRFI at <https://github.com/johnwcowan/r7rs-work/blob/master/CompoundObjectsCowan.md>, and there's an implementation by Arvydas, so it's ready to be submitted as soon as the SRFI backlog clears out.  Please review if you get a chance.



John Cowan          http://vrici.lojban.org/~cowan        xxxxxx@ccil.org
Heckler: "Go on, Al, tell 'em all you know.  It won't take long."
Al Smith: "I'll tell 'em all we *both* know.  It won't take any longer."


On Fri, Aug 14, 2020 at 11:43 AM Lassi Kortela <xxxxxx@lassi.io> wrote:
We're working an 'inner property into the next draft for chaining nested
errors together.

However, R6RS has a standard way to make compound conditions for that
purpose. Ideally, on R6RS systems, compound foreign statuses would be
represented by compound conditions.

<https://api.staging.scheme.org/static/r6rs-lib-errata-corrected.pdf>
page 26.

I assume no other systems have compound conditions except R6RS and maybe
Racket, though I can't find them in Racket's manual other than the R6RS
compatibility section. Common Lisp does not have them. Clojure
exceptions are java.lang.Exception subclasses, so unlikely as well.