On Sun, Aug 14, 2005 at 03:48:22PM +0200, Daniel Brockman wrote:
: Exegesis 3 contains this snippet,
: 
:    my $inflation;
:    print "Inflation rate: " and $inflation = +<>
:        until $inflation != NaN;
: 
: but the rule that +"hello" evaluates to NaN is "no longer"
: mentioned in S03, according to Autrijus.
: 
: He suggested I post here to get a ruling.

I'm not sure it ever was mentioned in S03, but we'd like to stick as
close as we can to IEEE floating point, and that includes NaN as
a value that can be stored not only in a Num but also in a num.
(Along with +Inf and -Inf).  I suppose machines that don't do IEEE
floating point will have to emulate num with Num.

If we go with class names being the undefined prototypical values,
and if we assume that NaN is an "unthrown exception" variant of
the undefined value for object types like Num, then we might even
end up with Num == NaN, albeit with different exception information
hidden inside.  Num is "not yet defined", whereas NaN is "tried to
convert 'hello' to number at inflate line 2" or some such.

Larry

Reply via email to