unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: Zelphir Kaltstahl <zelphirkaltstahl@posteo.de>
Cc: Guile User <guile-user@gnu.org>
Subject: Re: #:printer filed in language specification.
Date: Sun, 19 Sep 2021 14:24:37 +0200	[thread overview]
Message-ID: <c85780b9cb5cbe70085a953a89a3b44047586139.camel@telenet.be> (raw)
In-Reply-To: <b819528c-158c-c2ff-8519-8e2bf1b80737@posteo.de>

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

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 #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

  reply	other threads:[~2021-09-19 12:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17 22:50 #:printer filed in language specification Justin Veilleux
2021-09-18 14:47 ` Maxime Devos
2021-09-18 15:24   ` Justin Veilleux
2021-09-19 12:11   ` Zelphir Kaltstahl
2021-09-19 12:24     ` Maxime Devos [this message]
2021-09-20  8:04       ` Zelphir Kaltstahl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c85780b9cb5cbe70085a953a89a3b44047586139.camel@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=guile-user@gnu.org \
    --cc=zelphirkaltstahl@posteo.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).