guile-user
[Top][All Lists]
Advanced

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

#:getter procedure returns unexpected value in GOOPS


From: Diogo F. S. Ramos
Subject: #:getter procedure returns unexpected value in GOOPS
Date: Fri, 25 Apr 2014 20:24:12 -0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

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 not too familiar with GOOPS, so I'm not sure this is the right
behavior.

I'm using Guile 2.0.11.



reply via email to

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