From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Panicz Maciej Godek Newsgroups: gmane.lisp.guile.devel Subject: Re: goops - guile-clutter unexpected bug while using #:virtual slot allocation for a subclass Date: Sat, 20 Dec 2014 00:42:38 +0100 Message-ID: References: <20141219174633.6efb845e@capac> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11349a92953600050a9a43d9 X-Trace: ger.gmane.org 1419032570 29693 80.91.229.3 (19 Dec 2014 23:42:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Dec 2014 23:42:50 +0000 (UTC) Cc: guile-devel To: David Pirotte Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Dec 20 00:42:45 2014 Return-path: Envelope-to: guile-devel@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 1Y27C0-0003cO-TH for guile-devel@m.gmane.org; Sat, 20 Dec 2014 00:42:45 +0100 Original-Received: from localhost ([::1]:60927 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y27C0-0002Og-2h for guile-devel@m.gmane.org; Fri, 19 Dec 2014 18:42:44 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33784) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y27Bx-0002OX-3o for guile-devel@gnu.org; Fri, 19 Dec 2014 18:42:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y27Bv-0000tc-Qo for guile-devel@gnu.org; Fri, 19 Dec 2014 18:42:41 -0500 Original-Received: from mail-la0-x231.google.com ([2a00:1450:4010:c03::231]:51914) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y27Bv-0000tV-IJ for guile-devel@gnu.org; Fri, 19 Dec 2014 18:42:39 -0500 Original-Received: by mail-la0-f49.google.com with SMTP id hs14so1615725lab.8 for ; Fri, 19 Dec 2014 15:42:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=yUJIsV+Hzx79bY1UVNFJEKQQCcvYU05FEGNJLHbJOCQ=; b=BMThdxX05+zM4LEHqF52BX+yy2EiADkm2eIyauBYf0b4GjQOT7CfXh+HHxQEXGOaHi lrrBMJdMH2lWpVOpRNsWjLxkfixmjaRsSLIoSLd2V8f9TpccATY8okBWm6jw0LJDpL2f svmq5BVC9lO2zRS+h7j6ZrYbutsDpdCSpUdgii/F+Q9C8QPR7MH4iSTMasJv1UsBbMdy IvncpjddprcD5FFJLcWcs5MglClC6fIAk/xSP56BuSRW+ElzBjTzXtu7ZnJxSDAsDnrS YzaKKq3OeoKyXm1actuZEjEPMozQuMwMcg2w6EiwU/aVDux48zx2ZPclea6KW1NsNZHy oWGw== X-Received: by 10.152.164.232 with SMTP id yt8mr10376057lab.7.1419032558645; Fri, 19 Dec 2014 15:42:38 -0800 (PST) Original-Received: by 10.152.4.226 with HTTP; Fri, 19 Dec 2014 15:42:38 -0800 (PST) In-Reply-To: <20141219174633.6efb845e@capac> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::231 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:17624 Archived-At: --001a11349a92953600050a9a43d9 Content-Type: text/plain; charset=UTF-8 Hi, My first impression is that the error might be caused by using the combination of #:allocation #:virtual and #:init-keyword for the "colour" slot. Since #:init-keyword initializes slot value with a given value, and virtual slots have no actual value, the semantics of such operation is rather unclear. If your intention is to use the keyword as an argument to the constructor, you should rather provide a custom "initialize" method (and drop the "init-keyword" for the colour slot): (define-method (initialize (self ) args) (next-method) (let-keywords args #t ((colour (or #f some-default-value-you-wish))) (if colour (slot-set! self 'colour colour)))) HTH 2014-12-19 20:46 GMT+01:00 David Pirotte : > > Hello, > > It would be really nice if someone can help me with the following > unexpected bug: > > http://paste.lisp.org/+33RA > > I don't think i'll be able to solve it by myself, at this level of > knowledge I have > from both goops [implementation I mean, knowledge close to zero] and the > low level > machinery gnome/gobject/gtype.scm > > Many thanks, > David > --001a11349a92953600050a9a43d9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,<= /div>

My fir= st impression is that the error might be caused by using the combination of= #:allocation #:virtual and #:init-keyword for the "colour" slot.= Since #:init-keyword initializes slot value with a given value, and virtua= l slots have no actual value, the semantics of such operation is rather unc= lear.

= If your intention is to use the keyword as an argument to the constructor, = you should rather provide a custom "initialize" method (and drop = the "init-keyword" for the colour slot):

(define-method (initialize (se= lf <bar>) args)
=C2=A0 (next-method)<= /div>
=C2=A0 (let-keywords args #t ((colour (or #= f some-default-value-you-wish)))
=C2=A0 =C2= =A0 (if colour (slot-set! self 'colour colour))))

HTH

2014-12-19 20:46 GMT+01:00 Da= vid Pirotte <david@altosw.be>:
H= ello,

It would be really nice if someone can help me with the following unexpecte= d bug:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 http://paste.lisp.org/+33RA

I don't think i'll be able to solve it by myself, at this level of = knowledge I have
from both goops [implementation I mean, knowledge close to zero] and the lo= w level
machinery gnome/gobject/gtype.scm

Many thanks,
David
--001a11349a92953600050a9a43d9--