Discussion:
[Larceny-users] Regarding +inf.0
David Rush
2009-04-17 19:17:12 UTC
Permalink
I suspect that this is a behavior specified by R6RS, but why isn't
+inf.0 EQ? to itself? It is currently EQV? and EQUAL?, so I'm a little
confused.

david
--
GPG Public key at http://cyber-rush.org/drr/gpg-public-key.txt
Felix Klock
2009-04-17 19:26:42 UTC
Permalink
David (cc'ing larceny-use4rs)-
Post by David Rush
I suspect that this is a behavior specified by R6RS, but why isn't
+inf.0 EQ? to itself? It is currently EQV? and EQUAL?, so I'm a little
confused.
The *value* produced from evaluating the expression +inf.0 actually is
eq to "itself," as one would expect (for any object), as illustrated
below.
Post by David Rush
(eq? +inf.0 +inf.0)
#f
Post by David Rush
(let ((x +inf.0)) (eq? x x))
#t
Post by David Rush
(inexact? +inf.0)
#t

Beyond that, I do not understand your question; why would any two
boxed objects necessarily be eq? (All inexacts in the current version
of Larceny are boxed.)

-Felix
David Rush
2009-04-17 20:26:17 UTC
Permalink
Post by Felix Klock
Beyond that, I do not understand your question; why would any two
boxed objects necessarily be eq?  (All inexacts in the current version
of Larceny are boxed.)
That is the obvious answer which my sorely taxed neurons missed. Thank you.

The fact +inf.0 appears to be a singleton does not mean that it is *in
fact* one. I presume that none of the RnRS series addresses this. I
should elevate that to "almost certainly"; inexacts have always been
kinda funky.

david rush
--
GPG Public key at http://cyber-rush.org/drr/gpg-public-key.txt
Continue reading on narkive:
Loading...