guile-devel
[Top][All Lists]
Advanced

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

RE: Keywords in GOOPS methods


From: Maxime Devos
Subject: RE: Keywords in GOOPS methods
Date: Sat, 23 Nov 2024 16:49:14 +0100

>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 via email to

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