unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Maxime Devos via General Guile related discussions <guile-user@gnu.org>
To: "mikael@djurfeldt.com" <mikael@djurfeldt.com>
Cc: "janneke@gnu.org" <janneke@gnu.org>,
	guile-devel <guile-devel@gnu.org>,
	"Ludovic Courtès" <ludo@gnu.org>, guile-user <guile-user@gnu.org>,
	"Andy Wingo" <wingo@pobox.com>
Subject: RE: Keywords in GOOPS methods
Date: Sat, 23 Nov 2024 16:49:14 +0100	[thread overview]
Message-ID: <20241123164914.gFpC2D00841pia206FpC0X@albert.telenet-ops.be> (raw)
In-Reply-To: <CAA2XvwLyuPc8X=QMaAFthYkusJEFyQLAcz46HkPPSx9DJ=9Evg@mail.gmail.com>

>Well, these particular examples aren't valid since GOOPS doesn't allow type specifiers for keyword arguments. (It's the same in CLOS.) Type dispatch is done *only* on the required arguments.

That’s a shame, it should support them IMO, it’s a major limitation if it doesn’t.

A variant with untyped keyword arguments:

(define-method (f (a <keyword>) (b <symbol>))
  (pk 'positional))

(define-method (f (#:key foo))
  (pk 'optional-keyword foo))

(f #:foo 'bar)

Who should win? Both are a quite specific match.

Best regards,
Maxime Devos


  reply	other threads:[~2024-11-23 15:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-19 16:41 Keywords in GOOPS methods Mikael Djurfeldt
2024-11-21 20:33 ` Mikael Djurfeldt
2024-11-21 20:33   ` Mikael Djurfeldt
2024-11-21 22:00   ` janneke
2024-11-21 22:51     ` Mikael Djurfeldt
2024-11-22 11:46       ` Tomas Volf
2024-11-22 12:28         ` Mikael Djurfeldt
2024-11-22 12:20       ` janneke
2024-11-22 12:29         ` Mikael Djurfeldt
2024-11-22 23:04           ` Mikael Djurfeldt
2024-11-25 23:51         ` Keywords in define-method Mikael Djurfeldt
2024-11-26  0:13           ` Mikael Djurfeldt
2024-11-26  9:33             ` Mikael Djurfeldt
2024-11-26 18:40               ` Mikael Djurfeldt
2024-11-23 15:31       ` Keywords in GOOPS methods Maxime Devos via General Guile related discussions
2024-11-23 15:41         ` Mikael Djurfeldt
2024-11-23 15:49           ` Maxime Devos via General Guile related discussions [this message]
2024-11-24 11:56             ` Mikael Djurfeldt

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=20241123164914.gFpC2D00841pia206FpC0X@albert.telenet-ops.be \
    --to=guile-user@gnu.org \
    --cc=guile-devel@gnu.org \
    --cc=janneke@gnu.org \
    --cc=ludo@gnu.org \
    --cc=maximedevos@telenet.be \
    --cc=mikael@djurfeldt.com \
    --cc=wingo@pobox.com \
    /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).