From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.bugs Subject: Re: stack overflow equal? values Date: Fri, 19 Jan 2007 09:42:17 +1100 Message-ID: <8764b4aree.fsf@zip.com.au> References: <877ivlz0ua.fsf@zip.com.au> <87sle8ebld.fsf@laas.fr> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1169160171 7204 80.91.229.12 (18 Jan 2007 22:42:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 18 Jan 2007 22:42:51 +0000 (UTC) Cc: bug-guile@gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Thu Jan 18 23:42:48 2007 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1H7fxx-0005KI-Qz for guile-bugs@m.gmane.org; Thu, 18 Jan 2007 23:42:42 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H7fxy-0003fG-NN for guile-bugs@m.gmane.org; Thu, 18 Jan 2007 17:42:42 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H7fxv-0003d7-V0 for bug-guile@gnu.org; Thu, 18 Jan 2007 17:42:40 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H7fxu-0003ba-87 for bug-guile@gnu.org; Thu, 18 Jan 2007 17:42:39 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H7fxu-0003bX-3Z for bug-guile@gnu.org; Thu, 18 Jan 2007 17:42:38 -0500 Original-Received: from [61.8.2.215] (helo=mailout1.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H7fxt-0001AX-99 for bug-guile@gnu.org; Thu, 18 Jan 2007 17:42:37 -0500 Original-Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout1.pacific.net.au (Postfix) with ESMTP id 873B45A0C10; Fri, 19 Jan 2007 09:42:35 +1100 (EST) Original-Received: from localhost (ppp2EA5.dyn.pacific.net.au [61.8.46.165]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id CEB638C1A; Fri, 19 Jan 2007 09:42:34 +1100 (EST) Original-Received: from gg by localhost with local (Exim 4.63) (envelope-from ) id 1H7fxZ-0001co-RE; Fri, 19 Jan 2007 09:42:17 +1100 Original-To: "Marco Maggi" Mail-Copies-To: never In-Reply-To: <87sle8ebld.fsf@laas.fr> (Ludovic =?iso-8859-1?Q?Court=E8s's?= message of "Thu, 18 Jan 2007 13:57:50 +0100") User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:3465 Archived-At: ludovic.courtes@laas.fr (Ludovic Court=E8s) writes: > > I propose the following simple fix. Ok to apply? Yep, looks good. After I posted I wondered if the values struct is an actual "s" or if there's some strange extra I couldn't spot. Testing eq avoids worrying about that. Dunno why values are a struct and not a smob cell. > Actually, `scm_i_struct_equalp ()' should also compare the "tail > elements" (when there are tail elements), Yes. > but their semantics are a > little fuzzy to me. In particular, I don't understand why the size of > the tail array can be specified in both `make-vtable-vtable' and > `make-struct': What does that mean? Which one should really be taken > into account? Dunno :). > It seems that the code is a bit unclear on this too: > > guile> (define v (make-vtable-vtable "pr" 0)) > guile> (define s (make-struct v 123)) > guile> (struct-ref s 10) > Segmentation fault A segv is a bug, obviously, whichever way it's actually meant to be. > (Looks like the API is so complex that few people actually bothered to > use it to its full extents. ;-)) The records level is friendlier I guess. For a long time I couldn't understand what "vtable" meant, I still don't think I quite do. Maybe the docs should be tweaked, to help show what structs are typically meant to be. > --- orig/test-suite/tests/structs.test > +++ mod/test-suite/tests/structs.test > @@ -82,12 +82,18 @@ > (set-owner! ball "Bill") > (string=3D? (owner ball) "Bill"))) >=20=20 > - (pass-if "equal?" You can make a with-test-prefix group if you like. An exercise of an actual values too will be good, maybe in eval.test. _______________________________________________ Bug-guile mailing list Bug-guile@gnu.org http://lists.gnu.org/mailman/listinfo/bug-guile