From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: [Guile-commits] GNU Guile branch, goops-cleanup, created. release_1-9-4-72-gb1955b1 Date: Sun, 08 Nov 2009 01:41:06 +0100 Message-ID: <87skcp6e71.fsf@gnu.org> References: <87eiocalhu.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1257640909 4596 80.91.229.12 (8 Nov 2009 00:41:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 8 Nov 2009 00:41:49 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Nov 08 01:41:42 2009 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N6vqg-0002rb-7P for guile-devel@m.gmane.org; Sun, 08 Nov 2009 01:41:42 +0100 Original-Received: from localhost ([127.0.0.1]:44102 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N6vqf-0005ux-M0 for guile-devel@m.gmane.org; Sat, 07 Nov 2009 19:41:41 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N6vqd-0005uc-Dh for guile-devel@gnu.org; Sat, 07 Nov 2009 19:41:39 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N6vqY-0005uA-PZ for guile-devel@gnu.org; Sat, 07 Nov 2009 19:41:39 -0500 Original-Received: from [199.232.76.173] (port=40824 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N6vqY-0005u7-MW for guile-devel@gnu.org; Sat, 07 Nov 2009 19:41:34 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:34915) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N6vqY-0002gS-0Y for guile-devel@gnu.org; Sat, 07 Nov 2009 19:41:34 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.50) id 1N6vqU-0002np-7A for guile-devel@gnu.org; Sun, 08 Nov 2009 01:41:30 +0100 Original-Received: from reverse-83.fdn.fr ([80.67.176.83]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 08 Nov 2009 01:41:30 +0100 Original-Received: from ludo by reverse-83.fdn.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 08 Nov 2009 01:41:30 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 111 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: reverse-83.fdn.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 18 Brumaire an 218 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-OS: x86_64-unknown-linux-gnu User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:F8jLLW1MtvawbtnYD3Dpb5DMuqc= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:9642 Archived-At: Hello! Andy Wingo writes: > On Thu 05 Nov 2009 19:13, ludo@gnu.org (Ludovic Courtès) writes: [...] >> "Andy Wingo" writes: >> >>> * libguile/deprecated.h (scm_vtable_index_vtable): Define as a synonym >>> for scm_vtable_index_self. >>> (scm_vtable_index_printer): Alias scm_vtable_index_instance_printer. >>> (scm_struct_i_free): Alias scm_vtable_index_instance_finalize. >>> (scm_struct_i_flags): Alias scm_vtable_index_flags. >> >> IIUC these are no longer negative indices, but why deprecate them? > > I think they are bad names. scm_vtable_index_vtable sounds nonsensical. > scm_vtable_index_printer prints instances, not the vtable itself. > scm_struct_i_free is only valid on vtables, and is just a function that > runs at finalization time, and doesn't actually free anything. > scm_struct_i_flags is only valid on vtables. OK, I agree. >>> (SCM_STRUCTF_FLAGS): Be a -1 mask, we have a whole word now. >>> (SCM_SET_VTABLE_DESTRUCTOR): Implement by hand. >> >> Likewise. > > It is now deprecated to access flags through a mask, because the mask is > unnecessary. "Destructor" isn't mentioned anywhere else in Guile. OK. >>> Hidden slots. >>> >>> * libguile/struct.c (scm_make_struct_layout): Add support for "hidden" >>> fields, writable fields that are not visible to make-struct. This >>> allows us to add fields to vtables and not break existing make-struct >>> invocations. >> >> My first reaction was that it may make the struct layout code yet >> hairier. Would opaque fields be usable for that purpose? In what sense >> does it attempt to “not break existing make-struct invocations”? > > Imagine you have a vtable vtable with an extra field. The make-struct > invocation to make a vtable of that vtable-vtable is (make-struct > vtable-vtable layout printer extra-field). Hidden fields allow us to add > more fields to e.g. all vtables -- like a name -- without having > "extra-field" being interpreted as that extra field. Understood. And what’s the use case that prompted you to implement this? >> -typedef void (*scm_t_struct_free) (scm_t_bits * vtable, scm_t_bits * data); >> +typedef void (*scm_t_struct_finalize) (SCM obj); (Can you make sure these two type names appear in the log? It makes it easier to search for them.) >> I’m slightly concerned about the incompatibility. What’s the rationale? >> (I reckon that passing ‘scm_t_bits’ pointers to user code is not very >> elegant.) > > It was never documented, and only used by guile-gnome afaik. Better to > change it to do the right thing, then document it :-) I can’t help but think that if guile-gnome uses it, then others might as well use it. Could you make it a separate patch? >> - (let* ((vtable (make-vtable-vtable "pr" 0)) >> + (let* ((vtable (make-vtable "pr")) >> >> Does that mean that "hello" as a layout specifier was not detected as >> erroneous? > > Yes. Later commits cause this to raise an error. Nice. >> (I’ve always thought that ‘make-vtable-vtable’ has no good raison >> d’être. The GOOPS/CLOS model has only ‘make’, and it makes perfect >> sense to have a single procedure to “make things out of meta-things”.) > > A struct is an object. A vtable is a class. A vtable-vtable is a > metaclass. Metaclasses are themselves classes; and classes are > themselves objects. You need make-vtable-vtable to make a new strange > loop at the top, like being an instance of itself. Hmm I don’t see why ‘make-vtable-vtable’ is required to make the loop. But that’s another story. > It's confusing a bit, and delightful :) See > http://wingolog.org/pub/goops-inline-slots.png. Nice diagram! :-) >> Sounds good to me. It seems unlikely that these were used outside of >> Guile. What do you think? > > I think that's about right. But they correspond to a useful thing -- > applicable structs that are not generics. They'll come back, but with a > less confusing name. (I hate that name, "entity".) So do I. Cool, thanks! Ludo’.