[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Idiomatic Guile for semigroup/monoid/group?
From: |
Stuart Hungerford |
Subject: |
Re: Idiomatic Guile for semigroup/monoid/group? |
Date: |
Tue, 4 Jan 2022 08:02:23 +1100 |
On Mon, Jan 3, 2022 at 9:14 PM Maxime Devos <maximedevos@telenet.be> 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