[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: #:getter procedure returns unexpected value in GOOPS
From: |
David Pirotte |
Subject: |
Re: #:getter procedure returns unexpected value in GOOPS |
Date: |
Sat, 26 Apr 2014 19:19:09 -0300 |
Hello,
> I tried changing all to `#:init-value', but the result was the same.
Imo, using your definitions, guile should return 'foo, not 42.
But note that you do not define a getter in <bar>. Still using your code the
following will work:
(foo-a (make <foo>))
(slot-ref (make <bar>) 'a)
Then if you define a getter..., you also get the expected result
Cheers,
David
;;
GNU Guile 2.0.11.2-0ece4
scheme@(guile-user)>
scheme@(guile-user)>
(use-modules (oop goops))
(define-class <foo> ()
(a #:init-value 'foo #:getter foo-a)
(b #:init-value 42))
(define-class <bar> (<foo>)
(a #:init-value 'bar #:getter foo-a))
(foo-a (make <foo>))
(foo-a (make <bar>))
$2 = foo
$3 = bar
scheme@(guile-user)>
Re: #:getter procedure returns unexpected value in GOOPS, Mark H Weaver, 2014/04/26