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

Re: bounded, infinite ranges?



/// Excuse me if this question has been asked before ... but since the
/// Dylan language has IEEE floats and thus contains infinities, couldn't
/// the "up-to:", "through:" or "size:" parameters for a range be
/// infinite?  One could thus have an infinite range which is still
/// bounded.  If this supposition is true, perhaps the language definition
/// should be changed so that infinite ranges are always treated as
/// unbounded.

I'm not entirely sure this would be a good idea for infities, but it should
be for a bottom (NaN) value.  My reason: a range is over floats, yes?
Therefore no enumerative approach would terminate (any range has an infinite
number of elements), even if one was provided.

/// Oh, that reminds me: what is the Dylan syntax for infinities, NaNs, and
/// other IEEE goodies?  They don't seem to be specified in the April '92
/// manual.

Yes.  I was rather disapointed by this myself, tho' it was plenty easy to be
happy with the rest.

These values that sit outside the system, "top" and "bottom" values are usually
very important to a program.  IMHO, it was unfortunate that they were left out
of the Dylan language spec.  Sometimes, one wants to return an integer from a
function, for example, and also be able to return an error value.  One can't
use -1 or 0 or whatever.  This is a classic LISP style problem that was made
even worse in older LISPs by using 'nil' to represent _every_ bottom value
(including class 'cons's bottom value).

In fact, I'm such a big fan of top and bottom values that I might ask that some
more generic solution to the problem of writing Nan and Infinity in a program
be found -- one that will also let me write (error |Empty list has no sum|) as
a _value_ (this is _LISP_ after all, and the value is king :-) so that I can
return it from 'sum' if passed the empty list...

/// atw

	-- Scot

Llamas?  I thought they were CAMLs!