From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel Subject: Proposal: deprecate low-level numeric predicates Date: Tue, 01 Mar 2011 14:20:58 -0500 Message-ID: <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 1299007843 32107 80.91.229.12 (1 Mar 2011 19:30:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 1 Mar 2011 19:30:43 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Mar 01 20:30:39 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 1PuVHK-00052P-VC for guile-devel@m.gmane.org; Tue, 01 Mar 2011 20:30:39 +0100 Original-Received: from localhost ([127.0.0.1]:40418 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PuVHK-0006Qd-65 for guile-devel@m.gmane.org; Tue, 01 Mar 2011 14:30:38 -0500 Original-Received: from [140.186.70.92] (port=33255 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PuV8N-0002aJ-V6 for guile-devel@gnu.org; Tue, 01 Mar 2011 14:21:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PuV84-00051R-O7 for guile-devel@gnu.org; Tue, 01 Mar 2011 14:21:06 -0500 Original-Received: from world.peace.net ([216.204.32.208]:59366) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PuV84-000519-LB for guile-devel@gnu.org; Tue, 01 Mar 2011 14:21:04 -0500 Original-Received: from ip68-9-118-38.ri.ri.cox.net ([68.9.118.38] helo=freedomincluded) by world.peace.net with esmtpa (Exim 4.69) (envelope-from ) id 1PuV7z-000523-DD; Tue, 01 Mar 2011 14:20:59 -0500 Original-Received: from mhw by freedomincluded with local (Exim 4.69) (envelope-from ) id 1PuV7y-0006xt-Nv; Tue, 01 Mar 2011 14:20:58 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 216.204.32.208 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:11741 Archived-At: 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. 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. In the future, Guile will support additional representations for inexact reals, for example arbitrary-precision floating-point numbers. SCM_NUMBERP, SCM_NUMP, and SCM_INEXACTP ought to be deprecated, and replaced with internal versions. 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). SCM_VALIDATE_NUMBER ought to be changed to use scm_is_number, in order to support GOOPS numeric classes. What do you think? Mark