[r6rs-discuss] [Formal] Clean-up in the additional arithmetic libraries
Felix Klock wrote:
> If I understand your idea correctly, after importing the (r6rs
> arithmetic fixnum) library, (real? 2.3) would evaluate to #f.
>
> That is not what I would call consistent.
>
> (There may be some refinement of your idea that I support. But
> exporting fixnum? with the name real? does not make sense to me.)
It gave me a slight touch of vertigo too, at first, but it seemed
natural once I realized that the arithmetic libraries effectively
redefine what a number is (among other things).
I can write "numbers" in unary as follows:
'()
'(#t)
'(#t #t)
'(#t #t #t)
...
Obviously, I cannot use the standard arithmetic operations on these.
Therefore, for the purposes of Scheme, these are not numbers. I would
expect that we're all happy with this.
Now, if you import a routine called "+" from (r6rs arithmetic fixnum),
it no longer works on things like[*] "2.3". Therefore, from the point of
view of that routine, "2.3" is no longer a number. If it isn't a number,
it can't be a real.
However, I don't think it would be a disaster if that part of the
library were kept as it is and I also don't think that my suggestions
are infalible. I really just want some consistency both within the
libraries (e.g., don't used both "fixnum" and "fixnum-" for prefixes)
and between the libraries (e.g., don't use "=" and "prefix-=?"). The
arithmetic libraries seems to have been transplanted directly from the
SRFI; the SRFI was written in a context without a well-defined library
system; the context of R6RS is richer in this respect.
Regards,
Alan
[*] "things like" = "objects whose external representation is"
Received on Wed Nov 15 2006 - 13:48:59 UTC
This archive was generated by hypermail 2.3.0
: Wed Oct 23 2024 - 09:15:00 UTC