[Top][All Lists]

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

GOOPS: is this a bug?

From: Anders Vinjar
Subject: GOOPS: is this a bug?
Date: 26 Jul 2003 09:41:46 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)

[sending this to guile-devel after first trying guile-user, where
i got no response.  AV.]

A question about inheritance of getters/setters and overwriting
and such.  The following sequence hits an error (guile v. 1.6):

  (define-class <super-1> (<object>)
    (sl1 #:init-form 10 #:getter slot))

  (define-class <super-2> (<super-1>)
    (sl2 #:init-form 100 #:accessor slot))

  (define-class <sub-1> (<super-1>)
    (sl3 #:init-form 'hey #:getter subslot))

  (slot (make <sub-1>))

- claiming theres no applicable method for 'slot in the last


  (compute-slots (class-of (make <sub-1>)))


  ((sl1 #:init-form 10 #:init-thunk #<procedure #f ()> #:getter #<<generic> 
slot (3)>)
   (sl3 #:init-form (quote hei) #:init-thunk #<procedure #f ()> #:getter 
#<<generic> subslot (1)>))

- indicating there is a generic function 'slot (with 3 methods?) to
access the inherited slot.


  (describe slot)

- lists only the two methods for <super-1> and <super-2>

If i leave out the definition of 'slot as an accessor - in
<super-2> - things work as expected with regards to <sub-1>.

Is this a bug?  If not, how is a way to access the inherited slot
by the method specified together with the slot?

Anders Vinjar

reply via email to

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