guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Idiomatic Guile for semigroup/monoid/group?


From: Maxime Devos
Subject: Re: Idiomatic Guile for semigroup/monoid/group?
Date: Mon, 03 Jan 2022 10:14:26 +0000
User-agent: Evolution 3.38.3-1

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.

Greetings,
Maxime.

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]