unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Proposal: deprecate low-level numeric predicates
@ 2011-03-01 19:20 Mark H Weaver
  2011-03-09 21:59 ` Andy Wingo
  0 siblings, 1 reply; 4+ messages in thread
From: Mark H Weaver @ 2011-03-01 19:20 UTC (permalink / raw)
  To: guile-devel

Daniel Llorens <dll@bluewin.ch> 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



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-03-26 22:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-01 19:20 Proposal: deprecate low-level numeric predicates Mark H Weaver
2011-03-09 21:59 ` Andy Wingo
2011-03-09 23:28   ` Strategy for supporting GOOPS based numeric types Mark H Weaver
2011-03-26 22:20     ` Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).