From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Pirotte Newsgroups: gmane.lisp.guile.user Subject: Re: #:getter procedure returns unexpected value in GOOPS Date: Sat, 26 Apr 2014 19:19:09 -0300 Message-ID: <20140426191909.3902016f@capac> References: <87mwf9hu1v.fsf@nebulosa.milkyway> <877g6ccm4w.fsf@ossau.homelinux.net> <87a9b8hu46.fsf@nebulosa.milkyway> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1398550817 16169 80.91.229.3 (26 Apr 2014 22:20:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 26 Apr 2014 22:20:17 +0000 (UTC) Cc: guile-user@gnu.org To: "Diogo F. S. Ramos" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Apr 27 00:20:10 2014 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WeAx7-0004FA-8H for guile-user@m.gmane.org; Sun, 27 Apr 2014 00:20:09 +0200 Original-Received: from localhost ([::1]:37379 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WeAx6-0005ld-64 for guile-user@m.gmane.org; Sat, 26 Apr 2014 18:20:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45692) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WeAwr-0005bX-1K for guile-user@gnu.org; Sat, 26 Apr 2014 18:20:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WeAwj-0005ez-HV for guile-user@gnu.org; Sat, 26 Apr 2014 18:19:52 -0400 Original-Received: from maximusconfessor.all2all.org ([79.99.200.102]:53231) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WeAwj-0005da-Af for guile-user@gnu.org; Sat, 26 Apr 2014 18:19:45 -0400 Original-Received: from localhost (unknown [192.168.0.2]) by maximusconfessor.all2all.org (Postfix) with ESMTP id D632EA04C0F3; Sun, 27 Apr 2014 00:19:22 +0200 (CEST) Original-Received: from maximusconfessor.all2all.org ([192.168.0.1]) by localhost (maximusconfessor.all2all.org [192.168.0.2]) (amavisd-new, port 10024) with ESMTP id zitiKiUnPhEJ; Sun, 27 Apr 2014 00:01:06 +0200 (CEST) Original-Received: from capac (unknown [189.60.2.251]) by maximusconfessor.all2all.org (Postfix) with ESMTPSA id 31B89A04C10E; Sun, 27 Apr 2014 00:19:14 +0200 (CEST) In-Reply-To: <87a9b8hu46.fsf@nebulosa.milkyway> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.23; x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 79.99.200.102 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:11227 Archived-At: 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 . Still using your code the following will work: (foo-a (make )) (slot-ref (make ) '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 () (a #:init-value 'foo #:getter foo-a) (b #:init-value 42)) (define-class () (a #:init-value 'bar #:getter foo-a)) (foo-a (make )) (foo-a (make )) $2 = foo $3 = bar scheme@(guile-user)>