unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* (GOOPS) Specializing <generic>
@ 2003-07-30  7:59 Ludovic Courtès
  0 siblings, 0 replies; only message in thread
From: Ludovic Courtès @ 2003-07-30  7:59 UTC (permalink / raw)


Hi,

I'm new to GOOPS and am currently playing around with the MOP.  One
thing I tried to do what to change the default behaviour of
`apply-method' by creating my own class that inherits from <generic> and
then adding a specific apply-method method (this has already been
discussed in [1]):

  (define-class <my-generic> (<generic>))
  (define a-my-generic (make <my-generic> #:name 'a-my-generic))
  (define m (make <method> 
             #:specializers (list <top>)
             #:procedure (lambda (x) 'foo)))

  (add-method! a-my-generic m)

However Guile ends up complaining:

  ERROR: In procedure %invalidate-method-cache!:
  ERROR: Wrong type argument in position 1: #<<my-generic> a-my-generic (1)>
  ABORT: (wrong-type-arg)

Is there a way this could be fixed?

Also, I'm wondering why GOOPS doesn't have specific method keywords
allowing to define methods that gets executed before, after or `around'
a given method (like what CLOS has)?

Thanks,
Ludovic.

[1] http://mail.gnu.org/archive/html/guile-user/2002-04/msg00197.html


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


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

only message in thread, other threads:[~2003-07-30  7:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-30  7:59 (GOOPS) Specializing <generic> Ludovic Courtès

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).