Re: [Scheme-reports] Formal Comment: R7RS 'eqv?' cannot be used for reliable memoization Mark H Weaver (20 Nov 2012 09:33 UTC)

Re: [Scheme-reports] Formal Comment: R7RS 'eqv?' cannot be used for reliable memoization Mark H Weaver 20 Nov 2012 09:29 UTC

Ray Dillinger <bear@sonic.net> writes:
> I see +0.0 and -0.0 as branch cut selectors.

Basically, yes.  The usual way to think about them is (f +0.0) is the
limit of (f x) as x approaches zero from above, and (f -0.0) is the
limit of (f x) as x approaches zero from below.

> Branch cut selectors are strictly unnecessary in a
> language that has the ability to return multiple values
> from a function; the alternative is to simply return
> both (or all) answers at non-continuous points.

That would not be sufficient, because then the program would be left to
decide which of those multiple values is the right one.

For example, suppose 'z' is (make-rectangular -1 (- epsilon)) where
'epsilon' is approaching zero in some loop.  Signed zeroes ensure that
(log z) approaches -pi, and does not abruptly change to +pi when the
imaginary part of 'z' underflows.

If (log z) abruptly starts returning two values, how is the program
supposed to cope with that?  How does it decide which one to choose?

     Mark

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports