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: [PATCH] First batch of numerics changes Date: Fri, 28 Jan 2011 12:41:20 +0100 Message-ID: References: <87lj2762xc.fsf@yeeloong.netris.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1296222375 27612 80.91.229.12 (28 Jan 2011 13:46:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 28 Jan 2011 13:46:15 +0000 (UTC) Cc: guile-devel@gnu.org To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Jan 28 14:46:09 2011 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.69) (envelope-from ) id 1PioeM-0000J8-Vd for guile-devel@m.gmane.org; Fri, 28 Jan 2011 14:46:07 +0100 Original-Received: from localhost ([127.0.0.1]:46995 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PioeM-0004y9-Dp for guile-devel@m.gmane.org; Fri, 28 Jan 2011 08:46:06 -0500 Original-Received: from [140.186.70.92] (port=43091 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PioeK-0004y2-5E for guile-devel@gnu.org; Fri, 28 Jan 2011 08:46:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PioeI-0002Y0-7A for guile-devel@gnu.org; Fri, 28 Jan 2011 08:46:04 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:49654 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PioeH-0002Xa-VM for guile-devel@gnu.org; Fri, 28 Jan 2011 08:46:02 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 851FB3D0E; Fri, 28 Jan 2011 08:46:51 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=seAUcY4MjIvs4j5AtPVyoqJ3TY8=; b=AfqZp3 RELjOwIC1KOF6LtTcdytyohKcwuRIhvH3WifYLLgm7C2rBYPdlHjID+aQVLQ9HZe GfbfLrp2C0HPoI4j0OsP3RA+F2lrkDAqRHwa4i5RkgO2E736hjg4iKAB4enJ40u2 wDE5FIV3PdNgeQ/hZxl7U2GwSwLPcrKS4Tw64= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=cY6RKGaWzeL07oTxMw710Ey2YM9HCcCO 5zJ2B3XGQWnru7d0sze2h7ZjMCwq2YXV3gRdFMM5I6ukN0kXkkG1BR3fpTYWNikD WKkETtZ/XDIYQb+wnBR5jSlQK6GRTf6pkf6ui+vLjKZlTGvY9CidjiIiFzPnePl4 +jf0939jDwE= 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 6F3663D06; Fri, 28 Jan 2011 08:46:50 -0500 (EST) Original-Received: from unquote.localdomain (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 9E34A3CFF; Fri, 28 Jan 2011 08:46:48 -0500 (EST) In-Reply-To: <87lj2762xc.fsf@yeeloong.netris.org> (Mark H. Weaver's message of "Wed, 26 Jan 2011 11:32:47 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 0EB7D4DC-2AE5-11E0-9D1B-BC4EF3E828EC-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 64.74.157.62 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:11374 Archived-At: Hi Mark, On Wed 26 Jan 2011 17:32, Mark H Weaver writes: I don't understand this change: > From c42d03050ea0f96556e73e405e530b78bb85aba7 Mon Sep 17 00:00:00 2001 > From: Mark H Weaver > Date: Wed, 26 Jan 2011 02:56:20 -0500 > Subject: [PATCH] Add case for fractions with differing SCM_CELL_TYPE to scm_equal_p > > * libguile/eq.c (scm_equal_p): Add a special case for fractions with > differing SCM_CELL_TYPE, which might nonetheless be considered equal > (due to the use of 0x10000 as a flag), to scm_equal_p. This code > was already present in scm_eqv_p. > > (scm_eqv_p): Move comment (regarding special case for fractions) > next to the corresponding code. > --- > libguile/eq.c | 19 +++++++++++++------ > 1 files changed, 13 insertions(+), 6 deletions(-) > > diff --git a/libguile/eq.c b/libguile/eq.c > index 7502559..dc548b8 100644 > @@ -322,6 +322,13 @@ scm_equal_p (SCM x, SCM y) > && SCM_COMPLEX_IMAG (x) == 0.0); > } > > + /* fractions use 0x10000 as a flag (at the suggestion of Marius Vollmer), > + but this checks the entire type word, so fractions may be accidentally > + flagged here as unequal. Perhaps I should use the 4th double_cell word? > + */ > + if (SCM_FRACTIONP (x) && SCM_FRACTIONP (y)) > + return scm_i_fraction_equalp (x, y); > + > /* Vectors can be equal to one-dimensional arrays. > */ > if (scm_is_array (x) && scm_is_array (y)) In what case would two fractions ever not have the same SCM_CELL_TYPE ? I don't understand this discussion of flags. AFAICS fractions have their own tc16, and no flags are ever set. Furthermore I would think that the `if (SCM_NUMP (x))' block in scm_eqv_p could use a switch statement instead of a bunch of ifs. Regards, Andy -- http://wingolog.org/