From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: goops proposal: proper struct classes Date: Tue, 22 Nov 2011 23:23:00 +0100 Message-ID: <87aa7npzjv.fsf@pobox.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1322000595 28715 80.91.229.12 (22 Nov 2011 22:23:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 22 Nov 2011 22:23:15 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Nov 22 23:23:11 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RSykA-0008H1-Oy for guile-devel@m.gmane.org; Tue, 22 Nov 2011 23:23:11 +0100 Original-Received: from localhost ([::1]:60306 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSykA-00089e-4V for guile-devel@m.gmane.org; Tue, 22 Nov 2011 17:23:10 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:50548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSyk7-00089Z-Lb for guile-devel@gnu.org; Tue, 22 Nov 2011 17:23:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RSyk6-0000sJ-4X for guile-devel@gnu.org; Tue, 22 Nov 2011 17:23:07 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([74.115.168.62]:39344 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSyk5-0000rz-Tw for guile-devel@gnu.org; Tue, 22 Nov 2011 17:23:06 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 323668A44 for ; Tue, 22 Nov 2011 17:23:04 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=ANy/y2Pztyoj/9F5WkFUVvNRK2E=; b=j/wlqS U3AaQtMHWL65brceq1gKi6YY1ZcQ8dHuYCYw3YhYmFyf+nrD6eUooWQYwJoUokC0 pGgpTBpO8HVWo6Taf/8ZSxPlIZiGm0V9bNlDv8vEgfFX293jJ+wPJurjWCppZQ+v msQc4OUDRqjuR5r47imm8fwAVMd8oTdzT5ozg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:subject :references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=UFTyfGONdGoyloseybIFxiQAij4o40kV JInuna5YEflFtx3xS8DCQyAMTZhJcq4nWX78hBghr5dOktttqGxj5GZHBs/4NPKZ N+2LOgRy3CNK8rFf/WWZZfxNyiffYiTvY+b8+w91EtjaWhKNswihaJivg+rW2Bnk 4OPzBskEtyk= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 29B568A43 for ; Tue, 22 Nov 2011 17:23:04 -0500 (EST) Original-Received: from badger (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 718CB8A42 for ; Tue, 22 Nov 2011 17:23:03 -0500 (EST) In-Reply-To: (Andy Wingo's message of "Sun, 01 May 2011 22:19:38 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-Pobox-Relay-ID: 8B4B629E-1558-11E1-8F2C-65B1DE995924-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 74.115.168.62 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:12920 Archived-At: Hi, Just some more details here, to get this off the back of my queue: On Sun 01 May 2011 22:19, Andy Wingo writes: > If you know GOOPS, then you know that we have classes, rooted at > . And indeed shows up a lot in documentation and in > code. But that's not how it is in CLOS: our corresponds to > their `standard-class'. They have a superclass, called `class', which > is the real root, and from which e.g. structure classes are derived. >From CLISP: [1]> (defstruct foo) FOO [2]> (class-of (make-foo)) # [3]> (class-of (class-of (make-foo))) # [4]> (class-precedence-list (class-of (make-foo))) (# # #) [5]> (class-precedence-list (class-of (class-of (make-foo)))) (# # # # # # # # # #) > We need to do this. Currently, class-of on a struct/record data type > gives a useless class that can't instantiate instances, doesn't know its > slots, and does not reflect the vtable hierarchy. A slightly different case, but FWIW: scheme@(guile-user)> (class-precedence-list (class-of 1)) $1 = (#< 17ad960> #< 17ada50> #< 17adb40> #< 17adc30> #< 1172690>) scheme@(guile-user)> (class-precedence-list (class-of (class-of 1))) $2 = (#< 1172780> #< 11725a0> #< 1172690>) > So we need a , interposed between and , > which will be the real root of our class meta-object hierarchy. This is almost right: we do need in the cpl between and , but (and and, later, ) should still be an instance of . Andy -- http://wingolog.org/