guile-user
[Top][All Lists]
Advanced

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

(GOOPS) Specializing <generic>


From: Ludovic Courtès
Subject: (GOOPS) Specializing <generic>
Date: Wed, 30 Jul 2003 09:59:28 +0200
User-agent: Mutt/1.5.3i

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




reply via email to

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