unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#17355: #:getter procedure returns unexpected value in GOOPS
@ 2014-04-27  1:43 Diogo F. S. Ramos
  2016-06-21 13:12 ` Andy Wingo
  0 siblings, 1 reply; 2+ messages in thread
From: Diogo F. S. Ramos @ 2014-04-27  1:43 UTC (permalink / raw)
  To: 17355

When using GOOPS, if a class has a second slot, the #:getter procedure
of the first slot returns the value of the second slot when applied to
an instance of a subclass.

--8<---------------cut here---------------start------------->8---
(use-modules (oop goops))

(define-class <foo> ()
  (a #:init-form 'foo #:getter foo-a)
  (b #:init-form 42))

(define-class <bar> (<foo>)
  (a #:init-form 'bar))
--8<---------------cut here---------------end--------------->8---

  (foo-a (make <foo>)) => foo
  (foo-a (make <bar>)) => 42

I expected:

  (foo-a (make <bar>)) => bar

I'm using Guile 2.0.11.





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#17355: #:getter procedure returns unexpected value in GOOPS
  2014-04-27  1:43 bug#17355: #:getter procedure returns unexpected value in GOOPS Diogo F. S. Ramos
@ 2016-06-21 13:12 ` Andy Wingo
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Wingo @ 2016-06-21 13:12 UTC (permalink / raw)
  To: Diogo F. S. Ramos; +Cc: 17355-done

Thanks for the report!  This is fixed in Guile 2.0.11 and in 2.1.x,
though the full situation is a bit strange.

See: http://thread.gmane.org/gmane.lisp.guile.user/11218/focus=11813

Regards,

Andy

On Sun 27 Apr 2014 03:43, "Diogo F. S. Ramos" <dfsr@riseup.net> writes:

> When using GOOPS, if a class has a second slot, the #:getter procedure
> of the first slot returns the value of the second slot when applied to
> an instance of a subclass.
>
> (use-modules (oop goops))
>
> (define-class <foo> ()
>   (a #:init-form 'foo #:getter foo-a)
>   (b #:init-form 42))
>
> (define-class <bar> (<foo>)
>   (a #:init-form 'bar))
>
>   (foo-a (make <foo>)) => foo
>   (foo-a (make <bar>)) => 42
>
> I expected:
>
>   (foo-a (make <bar>)) => bar
>
> I'm using Guile 2.0.11.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-21 13:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-27  1:43 bug#17355: #:getter procedure returns unexpected value in GOOPS Diogo F. S. Ramos
2016-06-21 13:12 ` Andy Wingo

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