At 11:29 -0400 8/24/04, Dan Sugalski wrote: >What I'm thinking is that we add an O or X (or E, I don't care. I suppose we could >get more verbose there too) variant to the basic math ops which checks the result for >validity and throws an exception on something exceptional happening.
For floating point operations, and that's pretty much all perl 5 seems to do, the "not a number" or "NaN" capability of the floating point arithmetic units is pretty good. Correctly ignored, an error condition can resolve itself in a later formula. An underflow, for instance, when added to a legitimate floating point number is not an error. It's just a no-op. Even a divide by zero error can be a non-event. Things like real square roots of negative numbers are different. Perl6 could define some of its own NaN's if it seems appropriate. Perhaps a NaN meaning undef. A simple way to identify and categorize a NaN might be nice. -- --> On the eighth day, about 6 kiloyears ago, the Lord realized that free will would make man ask what existed before the Creation. So He installed a few gigayears of history complete with a big bang and a fossilized record of evolution. <--