On Mon, Jan 3, 2022 at 9:14 PM Maxime Devos <[email protected]> wrote:

> Stuart Hungerford schreef op ma 03-01-2022 om 10:46 [+1100]:
> > Just out of interest, are there other multimethod/ad-hoc polymorphism
> > approaches for Guile?
>
> I only know of GOOPS and Theme-D -- Guix also has a
> ‘define-gexp-compiler’ but it's very ad-hoc.
>
> It allows defining something like
>
> (define (lower stuff system target)
>   (cond ((derivation? stuff) stuff) ; done
>         ((foo? stuff) (lower (lower-foo stuff system target)))
>         ((bar? stuff) (lower (lower-bar stuff system target)))
>         [...]))
>
> (where 'lower-stuff' converts 'stuff' into something 'lowerable'),
> but in an extensible way.

That's interesting -- thanks.

Stu

Reply via email to