This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: SCM_VALIDATE_...
- To: Dirk Herrmann <dirk at ida dot ing dot tu-bs dot de>
- Subject: Re: SCM_VALIDATE_...
- From: Mikael Djurfeldt <mdj at mdj dot nada dot kth dot se>
- Date: 25 May 2000 11:26:23 +0200
- Cc: Guile Mailing List <guile at sourceware dot cygnus dot com>
- Cc: djurfeldt at nada dot kth dot se
- References: <Pine.LNX.4.21.0005251050280.5213-100000@marvin.ida.ing.tu-bs.de>
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?