Zelphir Kaltstahl schreef op zo 19-09-2021 om 12:11 [+0000]:
> Hi Maxim!
> 
> Do you know of any simple example anywhere for applicable structs? I might 
> have
> another use for them.

From NEWS in the Guile source code:

  ** Applicable struct support

  One may now make structs from Scheme that may be applied as procedures.
  To do so, make a struct whose vtable is `<applicable-struct-vtable>'.
  That struct will be the vtable of your applicable structs; instances of
  that new struct are assumed to have the procedure in their first slot.
  `<applicable-struct-vtable>' is like Common Lisp's
  `funcallable-standard-class'. Likewise there is
  `<applicable-struct-with-setter-vtable>', which looks for the setter in
  the second slot. This needs to be better documented.

For a not-very-simple example, see modules/oop/gooops.scm in Guile's source 
code.
I don't know any simple examples.

Greetings,
Maxime.

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

Reply via email to