From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludovic.courtes@laas.fr (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: make-vtable Date: Fri, 16 Feb 2007 09:12:43 +0100 Organization: LAAS-CNRS Message-ID: <87r6sqcyh0.fsf@laas.fr> References: <877iunt6yl.fsf@zip.com.au> <87r6suv5k2.fsf@laas.fr> <877iulwxzd.fsf@zip.com.au> <871wktrwur.fsf@laas.fr> <87tzxopinw.fsf@zip.com.au> <8764a3kdw8.fsf@laas.fr> <87zm7fm0c9.fsf@zip.com.au> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1171613575 11778 80.91.229.12 (16 Feb 2007 08:12:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 16 Feb 2007 08:12:55 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Feb 16 09:12:48 2007 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 1HHyD1-0003bj-Os for guile-devel@m.gmane.org; Fri, 16 Feb 2007 09:12:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HHyD1-0005tM-5y for guile-devel@m.gmane.org; Fri, 16 Feb 2007 03:12:47 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HHyCx-0005t7-4T for guile-devel@gnu.org; Fri, 16 Feb 2007 03:12:43 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HHyCv-0005sv-M3 for guile-devel@gnu.org; Fri, 16 Feb 2007 03:12:42 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HHyCv-0005ss-GK for guile-devel@gnu.org; Fri, 16 Feb 2007 03:12:41 -0500 Original-Received: from laas.laas.fr ([140.93.0.15]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.52) id 1HHyCv-0005gU-1D for guile-devel@gnu.org; Fri, 16 Feb 2007 03:12:41 -0500 Original-Received: by laas.laas.fr (8.13.8/8.13.8) with SMTP id l1G8Cc3G028070; Fri, 16 Feb 2007 09:12:39 +0100 (MET) X-URL: http://www.laas.fr/~lcourtes/ X-Revolutionary-Date: 28 =?iso-8859-1?Q?Pluvi=F4se?= an 215 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEB1F5364 X-PGP-Key: http://www.laas.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-OS: powerpc-unknown-linux-gnu Mail-Followup-To: guile-devel@gnu.org In-Reply-To: <87zm7fm0c9.fsf@zip.com.au> (Kevin Ryde's message of "Fri, 16 Feb 2007 11:07:34 +1100") User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) X-Spam-Score: 0.307 () MAILTO_TO_SPAM_ADDR X-Scanned-By: MIMEDefang at CNRS-LAAS on 140.93.0.15 X-detected-kernel: Solaris 10 (beta) 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:6529 Archived-At: Hi! Kevin Ryde writes: >> Thus, VTABLE is redundant. > > Well, except for the creation (and continued existance) of > scm_stack_type. Right. But the layout that's used for VTABLE is unneeded: VTABLE only needs REQUIRED_VTABLE_FIELDS. > Yes, as long as you don't want any extra fields in the vtable (which > is true for scm_stack_type). I thought of that for my make-vtable > func, > > (define make-vtable > (let ((vtable-vtable #f)) > (lambda (fields tail-size . print) > (or vtable-vtable > (set! vtable-vtable (make-vtable-vtable "" 0))) > (apply make-struct vtable-vtable tail-size > (make-struct-layout fields) > print)))) > > Then wondered if it was worth bothering with. I guess if it's used by > stacks.c too then it should share. (The name `struct-vtable' is taken > by a func, but some other global name ...) I think it'd be useful and easier to understand. Or maybe something like: (define %root-vtable (make-vtable-vtable "" 0)) (define (make-vtable layout printer) ;; LAYOUT must be a symbol. We only pass a two-element init list ;; (corresponding to REQUIRED_VTABLE_FIELDS) because the second ;; field is of type `s' and gets automatically initialized. (make-struct %root-vtable 0 layout printer)) (And it really works!) Both of which could (should?) be documented _before_ `make-vtable-vtable' is even mentioned. :-) > I think the problem is if you want extra fields in the vtables. Actually, one rarely needs it, just like one rarely needs to sub-class . So it's a nice thing to have, but not something that should make one's life harder. > Maybe > a third level of table descriptor could do that (as opposed to > self-vtabling roots). Because of the `s' field in REQUIRED_VTABLE_FIELDS, all vtables returned by `make-vtable-vtable' are "self-vtabling". I think it'd be clearer if there were only one self-vtabling vtable (`%root-vtable') from which all vtables would directly or indirectly inherit. Thus, REQUIRED_VTABLE_FIELDS would rather be "prprpw". But I guess this is more of a cosmetic issue. Thanks, Ludo'. _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel