Hi!

On Sat 26 Apr 2014 01:24, "Diogo F. S. Ramos" <d...@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 realize this is really late :)  But since this thread isn't linked to
a bug, note that this is now fixed in stable-2.0 and master, to match
the behavior in Guile 1.8 and previous, which is actually that:

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

because <bar> doesn't just define a different init-value for the slot,
it defines a different slot entirely.

Andy
-- 
http://wingolog.org/

Reply via email to