This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: SCM_VALIDATE_...


Dirk Herrmann <dirk@ida.ing.tu-bs.de> writes:

> I just renamed SCM_VALIDATE_NUMBER_COPY to SCM_VALIDATE_REAL_COPY.  But,
> then I noticed an inconsistency.  Currently we have a set of predicates 
> SCM_INUMP, SCM_BIGP, SCM_REALP, SCM_COMPLEXP.  These predicates are _not_
> comparable to the corresponding scheme level predicates, since, for
> example, SCM_REALP(x) is true _only_ if x is a real object, but it is
> false for an inum and a bigint.  In contrast (real? x) would be true also
> for integer and rational values.
> 
> The bad thing is, that in validate.h there is a predicate
> SCM_VALIDATE_REAL, which does nothing else than checking if the SCM_REALP
> predicate is fulfilled.  This does not go along very well with a predicate
> named SCM_VALIDATE_REAL_COPY, which accepts anything real in the
> real? sense.
> 
> This mismatch in behaviour is confusing and I think we should come up with
> something better.

Absolutely.  (This is the trouble of "design" by independent
incremental steps.  ;-)

Shall we first try to find out how we finally want it to look like,
and then see what we can do now, given what we have?

It seems most reasonable to change the name of SCM_REALP et al, don't
you think?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]