At 13:20 -0500 2/17/98, Tim Olson wrote:
...SNIP... The IEEE "default" operation is to silently return the default values (Inf or NaN), rather than generating an exception. What should the standard for Squeak be? -- tim
Tim:
The standard allows a trap handler to be specified which causes a trap when each of the various exceptions occur. With a trap handler in place in the VM, a floating point primitive failure can invoke another primitive to get the information on the most recent trap. Smalltalk can then take an appropriate action, like ignore the problem, take some standard system action, invoke a user supplied block, or whatever.
(There is the problem of two processes running floating point code and trapping at the same time; too bad that failed primitives can't answer values!)
I think, in order to follow the intent of the standard, that Squeak should take no action by default, but allow a global setting (say of a block) which will raise a Smalltalk exception. Individual operations could also specify blocks which apply just to that operation.
The standard suggests that trap handlers be a stack, so that a new one can be specified for a while, then the previous one restored.
Dave
_______________________________ David N. Smith IBM T J Watson Research Center Hawthorne, NY _______________________________ Any opinions or recommendations herein are those of the author and not of his employer.