unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Writing a generic function for records?
@ 2020-05-09  3:46 Stephen Paul Weber
  0 siblings, 0 replies; only message in thread
From: Stephen Paul Weber @ 2020-05-09  3:46 UTC (permalink / raw)
  To: guile-user

[-- Attachment #1: Type: text/plain, Size: 564 bytes --]

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-09  3:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-09  3:46 Writing a generic function for records? Stephen Paul Weber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).