From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.devel Subject: make-vtable Date: Tue, 13 Feb 2007 08:13:38 +1100 Message-ID: <877iunt6yl.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 1171314844 13874 80.91.229.12 (12 Feb 2007 21:14:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 12 Feb 2007 21:14:04 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Feb 12 22:13:56 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 1HGiUj-0005Y2-Qf for guile-devel@m.gmane.org; Mon, 12 Feb 2007 22:13:54 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HGiUj-0007az-8i for guile-devel@m.gmane.org; Mon, 12 Feb 2007 16:13:53 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HGiUf-0007Yj-D4 for guile-devel@gnu.org; Mon, 12 Feb 2007 16:13:49 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HGiUd-0007Xh-F5 for guile-devel@gnu.org; Mon, 12 Feb 2007 16:13:49 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HGiUd-0007Xe-9H for guile-devel@gnu.org; Mon, 12 Feb 2007 16:13:47 -0500 Original-Received: from mailout1-8.pacific.net.au ([61.8.2.215] helo=mailout1.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HGiUc-00032i-K6 for guile-devel@gnu.org; Mon, 12 Feb 2007 16:13:47 -0500 Original-Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout1.pacific.net.au (Postfix) with ESMTP id C31E65A0EBB for ; Tue, 13 Feb 2007 08:13:41 +1100 (EST) Original-Received: from localhost (ppp251C.dyn.pacific.net.au [61.8.37.28]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id 4E4F227411 for ; Tue, 13 Feb 2007 08:13:41 +1100 (EST) Original-Received: from gg by localhost with local (Exim 4.63) (envelope-from ) id 1HGiUV-0001pf-M4 for guile-devel@gnu.org; Tue, 13 Feb 2007 08:13:39 +1100 Mail-Copies-To: never User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:6519 Archived-At: I made a bit of a start trying to improve the structures section of the manual, I always found it pretty hard to follow. One big stumbling block for me was vtables, but I now see if you want to make a struct you have to make a vtable vtable, and from that a vtable, and only then your struct. Seems hard work for casual users, if you're not (at first) interested in that second level of "type of type". How about something like this to just make a vtable from fields and optional printer func, (define (make-vtable fields . print) (apply make-struct (make-vtable-vtable "" 0) 0 (make-struct-layout fields) print)) I suppose a func should be judged on whether it'd be used, but a make-vtable like this would certainly make the manual easier reading, since you can get started making structs just from the fields layout, and only later that learn details of sets of related types, extra slots in the vtable(s) for class data, etc. _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel