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

Re: Error objects in general



Paul Schlie wrote:
- Should there be an observable difference between assoc failing to find
  a match given operands with well defined values, vs. given operands having
  un-specified values?

Values are values. When we say "this expression returns an unspecified value" we mean "this expression returns a value, but precisely which value is unspecified". There is nothing special about unspecified values. So, no, assoc should not (indeed, cannot) do anything special with unspecified values because assoc sees them as plain values.

- Should a comparison operation (= 0 X) return #t #f or something else
  if the value of X is an unspecified NaN value? [as such a value may or may
  not be 0]?

Section 5.7 of IEEE 754 says #f.

- what should (list-ref x y) return if y had an un-specified value?

NaNs are inexact, so this should signal an error as y must be exact.

- or more generally, what value should (car #t) or (if #f #f) return?

The former should signal an error and the value of the latter is unspecified.

Regards,

Alan
--
Dr Alan Watson
Centro de Radioastronomía y Astrofísica
Universidad Astronómico Nacional de México