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 13:19:51 +0100 Message-ID: References: <87lj2762xc.fsf@yeeloong.netris.org> <87tygv4726.fsf@yeeloong.netris.org> <87fwse3stg.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 1296222387 27683 80.91.229.12 (28 Jan 2011 13:46:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 28 Jan 2011 13:46:27 +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:23 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 1PioeY-0000UR-JB for guile-devel@m.gmane.org; Fri, 28 Jan 2011 14:46:18 +0100 Original-Received: from localhost ([127.0.0.1]:47144 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PioeY-00053l-1v for guile-devel@m.gmane.org; Fri, 28 Jan 2011 08:46:18 -0500 Original-Received: from [140.186.70.92] (port=43245 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PioeT-00052b-EX for guile-devel@gnu.org; Fri, 28 Jan 2011 08:46:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PioeS-0002bu-6y for guile-devel@gnu.org; Fri, 28 Jan 2011 08:46:13 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:49883 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PioeS-0002bn-45 for guile-devel@gnu.org; Fri, 28 Jan 2011 08:46:12 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 5881E3D28; Fri, 28 Jan 2011 08:47:02 -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=HrDLbqdzoNHz6M49QZ1XM6Ilkh4=; b=oixCwE 5bLb5qG3OBYkwgo7CEBjmygV7glBiIQRkPPwGK039BhGwb2DbGfKOoFq69sne5DG H/F3jK3q1BqvIATJB5tqgMnhY55jKUZHIe6fJDGj6e3EBJJG9/09ccLch7OZ2gzu lb4Wx7SZ9AlMSnnuCEqDgJukMgrKtdbiF0SxY= 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=FeYc6lVOfEQvx+5auqI1mmcigCbhjyD/ 0nlTBX8q3VkLDQ0dSVY8qYZcbb8dsnEgK9s1sa33Xdmq+7GyzbCgpybTSKm3K9QJ lQvswGS1jbj/uIrTa/1CHJZNrsLYySQk6+GQuz5TkXgljwhVfJWYuza3KkdcfBfc rv7vjYlh+sc= 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 404C13D27; Fri, 28 Jan 2011 08:47:01 -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 5A3E63D26; Fri, 28 Jan 2011 08:46:59 -0500 (EST) In-Reply-To: <87fwse3stg.fsf@yeeloong.netris.org> (Mark H. Weaver's message of "Thu, 27 Jan 2011 17:06:19 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 152BB77A-2AE5-11E0-838C-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:11376 Archived-At: Hi Mark, On Thu 27 Jan 2011 23:06, Mark H Weaver writes: > I'm having second thoughts about two of the patches: > > * Patch 0010: `inf?' and `nan?' throw exceptions when applied to > non-numbers > > Previously, these predicates would return #f in that case. I tend to > prefer strictness, but perhaps backward compatibility is more important > than strictness here. What do you think? I think that certainly when it comes to numbers, strictness is good. In particular the r6rs says: (zero? z) procedure (positive? x) procedure (negative? x) procedure (odd? n) procedure (even? n) procedure (finite? x) procedure (infinite? x) procedure (nan? x) procedure The name of the argument indicates the type, as noted earlier in the report. `z' is a complex number, `x' is a real, and `n' is an integer. It is an error to pass a non-integer to even?. It is also an error to pass a non-real to infinite?. (Note that the domain of first 5 predicates is specified in R5RS as well.) Given that the R5RS does not discuss infinities, and they were only added in Guile 1.8 (I believe), I think we have some room for change. We should change to the R6RS semantics, I think. > I am leaning toward the following: > > (* 0 +inf.0) ==> +nan.0 > (* 0 +nan.0) ==> +nan.0 > (* 0 1.0) ==> 1.0 ==> 0.0, you mean. > (* 0 0.0) ==> 0.0 > > What do you think? I think your suggestion is a good one. But I don't really know what I'm talking about ;-) Andy -- http://wingolog.org/