unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* GOOPS: is this a bug?
@ 2003-07-26  7:41 Anders Vinjar
  0 siblings, 0 replies; only message in thread
From: Anders Vinjar @ 2003-07-26  7:41 UTC (permalink / raw)


[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
call.

However,

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

returns:

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

But:

  (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


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


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

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

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-26  7:41 GOOPS: is this a bug? Anders Vinjar

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