unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Anders Vinjar <andersvi@notam02.no>
Subject: GOOPS: is this a bug?
Date: 26 Jul 2003 09:41:46 +0200	[thread overview]
Message-ID: <m1u1997n0l.fsf@localhost.localdomain> (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


                 reply	other threads:[~2003-07-26  7:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1u1997n0l.fsf@localhost.localdomain \
    --to=andersvi@notam02.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).