[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Contagious Inexactness, revision 2

Andrew Wilcox <awilcox@xxxxxxxxxxxxxxxxx> writes:

> Two Scheme implementations returning results flagged as exact, from
> the same computation, performed on the same inputs, will return
> equal values.

I believe this is unimplementable sanely.

Assume, for the sake of argument, that
   (= (expt (sqrt 2) 2) 2)
is an example of an expression which is #t and #f on different
implementations. Of course with your proposal these are inexact

Now consider this:

(define (test)
  (let ((l '()))
    (if (= (expt (sqrt 2) 2) 2)
      (set! l (cons #f l)))
    (length l)))

Does this return an inexact 0 or 1? If yes, how would you implement this?

   __("<         Marcin Kowalczyk
   \__/       qrczak@xxxxxxxxxx
    ^^     http://qrnik.knm.org.pl/~qrczak/