chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] tinyclos question


From: felix
Subject: Re: [Chicken-users] tinyclos question
Date: Sun, 06 Apr 2003 23:42:09 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020529

Chris Double wrote:
I have the following code entered in the interpreter:

----------8<---------------
(define-class <window> (<object>) (window-handle))
(define-class <my-window> (<window>) ())

(define-class <expose-event> () ())

(define-generic handle-event)

(define-method (handle-event w type)
  (display w)
  (display " ")
  (display type))

(define-method (handle-event (w <my-window>) (e <expose-event>))
  (display "test"))
----------8<---------------
The following gives an error:

  (handle-event 1 2)
=> Error: call-next-method: no methods left: #<procedure>

If I comment out the last define-method specialised on <my-window> then (handle-event 1 2) works as expected.

If I specialize the first handle-event on <number> things also work. It only seems to occur if there is a method which has no specializers at all.
How do I create a method that is always called no matter what type is passed?


The class <top> is the superclass of all other classes (even
primitive classes). It's like the T in CLOS.


cheers,
felix






reply via email to

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