guile-user
[Top][All Lists]
Advanced

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

Writing a generic function for records?


From: Stephen Paul Weber
Subject: Writing a generic function for records?
Date: Fri, 8 May 2020 22:46:57 -0500
User-agent: Mutt/1.10.1 (2018-07-13)

Is it possible (Guile 3.0) to write a generic function / method for record values?

I see that a record has a GOOPS class <<myrec>>, and that a record-type has the GOOPS class <record-type>, but it seems that <<myrec>> is not a subclass of <record-type>?

I am playing with the ECMAscript implementation and would like to:

        (define-method (pget (rec <record-type>) (fld <symbol>))
                ((record-accessor (record-type-descriptor rec) fld) rec)
        )

Which I can write for any given record type, but should be possible to write for
all of them, maybe?

Attachment: signature.asc
Description: PGP signature


reply via email to

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