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: Proposal: deprecate low-level numeric predicates Date: Wed, 09 Mar 2011 22:59:07 +0100 Message-ID: References: <87ei6qsl45.fsf@netris.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1299707959 7083 80.91.229.12 (9 Mar 2011 21:59:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 9 Mar 2011 21:59:19 +0000 (UTC) Cc: guile-devel@gnu.org To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Mar 09 22:59:15 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 1PxRPW-0004Xg-7q for guile-devel@m.gmane.org; Wed, 09 Mar 2011 22:59:14 +0100 Original-Received: from localhost ([127.0.0.1]:42772 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxRPV-0003af-OF for guile-devel@m.gmane.org; Wed, 09 Mar 2011 16:59:13 -0500 Original-Received: from [140.186.70.92] (port=38135 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxRPT-0003aa-43 for guile-devel@gnu.org; Wed, 09 Mar 2011 16:59:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PxRPS-0000Pw-3A for guile-devel@gnu.org; Wed, 09 Mar 2011 16:59:11 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:33234 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PxRPS-0000PS-0g for guile-devel@gnu.org; Wed, 09 Mar 2011 16:59:10 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 1B53D4981; Wed, 9 Mar 2011 17:00:35 -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=pCURhm2lLQZDgIhAdWG6y/lyzl4=; b=szVpX+ E2Kkaq69fzJrOoTYlhC/FfJMzBkHq5VsWPH2aUP1tUJ/neWMQP6HvLUA+wzfxWB0 etEE5jUlbhzGX4iEfpfar3ZdwKzeGSNBICbfMrQDCZQxgSdBBvDr0xINX8kTmvna jSEZ1WWJzzOtNXHMrQ9EchtbHsA4SgpCd+KGs= 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=MAnrmymRJ4p8OsMm3BxRCB2RD6eC3hAM UesRn+blqAziBvQH1sDzKOk/ibG2oM6XEvEZe9RA7lmweiwqG9t8DATih4KtVZZv ZYpC/EAS+CB/GWSNQRh+gPHePst8KiiCTcpbwwkWU3nD4hHaulZEulyOXw9EeRbL q8Q+bP1fcKk= 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 F1EEB4980; Wed, 9 Mar 2011 17:00:32 -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 22BF3497C; Wed, 9 Mar 2011 17:00:30 -0500 (EST) In-Reply-To: <87ei6qsl45.fsf@netris.org> (Mark H. Weaver's message of "Tue, 01 Mar 2011 14:20:58 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: A7A13B20-4A98-11E0-9D4A-E8AB60295C12-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:11844 Archived-At: On Tue 01 Mar 2011 20:20, Mark H Weaver writes: > Daniel Llorens writes: >> I tried to look into SCM_VALIDATE_REAL per the comment, I didn't get >> far. > > Yes, SCM_VALIDATE_REAL (defined in validate.h) requires that the tested > value be an inexact real, i.e. floating-point. It will reject exact > integers or exact rationals. It really ought to be deprecated in > master, and replaced with a new validator that uses scm_is_real. Indeed. Its only mention in Guile is bytevectors.c:1667:/* FIXME: SCM_VALIDATE_REAL rejects integers, etc. grrr */ I think it's OK to deprecate in stable-2.0, actually, using the same mechanism as SCM_VALIDATE_INUM. > SCM_REALP and SCM_COMPLEXP should also be deprecated. It is very > confusing that these macros do not correspond to `real?' and `complex?'. > They should be replaced with renamed versions to reflect the fact that > they are testing for particular low-level numeric representations. > Maybe SCM_DOUBLE_P and SCM_COMPLEX_DOUBLE_P. Sounds good to me too. > SCM_NUMBERP, SCM_NUMP, and SCM_INEXACTP ought to be deprecated, and > replaced with internal versions. OK, but in master only please. > They check only for representations > supported by the core implementation, and do not properly support GOOPS > numeric classes (part of an upcoming patch series I'm working on). I'm a little concerned about the impact goops numbers would have on making type dispatch slower, like (cond ((symbol? x) ...) ((number? x) ...)) How many different kinds of numbers are we talking about? Would be nice to avoid having number? call a generic function. Dunno. > SCM_VALIDATE_NUMBER ought to be changed to use scm_is_number Sure. Anyone who really cares about speed will check for particular number types. In master only please, though, at least for now. Andy -- http://wingolog.org/