[Openmcl-devel] Empty operands list on DIVISION-BY-ZERO signal
gb at clozure.com
Wed Jun 29 19:15:07 CDT 2011
The ARITHMETIC-ERROR-OPERATION in your example is LOG, not /.
? (log 0)
> Error: DIVISION-BY-ZERO detected
> performing LOG on (0.0)
The spec defines ARITHMETIC-ERROR-OPERANDS and -OPERATION in terms of
"the offending call", but that term isn't well-defined. A
floating-point exception can (and sometimes is) raised by explicitly
setting a bit in a status register, and if there's a "call" involved
in that process it may not be a lisp function call ...
I don't think that you can assume that the offending call when a
DIVISION-BY-ZERO occurs is always a two-operand call to #'/. In cases
? (/ 0)
? (/ 1 2 0)
an implementation could legitimately consider the offending call to be
one with 1 or 3 operands.
You can probably assume that, if C is an ARITHMETIC-ERROR,
(APPLY (ARITHMETIC-ERROR-OPERATION C) (ARITHMETIC-ERROR-OPERANDS C))
will generate the same type of ARITHMETIC-ERROR as C if that type of FP
exception is enabled. I don't think that you can safely assume much more
On Wed, 29 Jun 2011, Gabriel Dos Reis wrote:
> On Wed, Jun 29, 2011 at 2:24 PM, Gabriel Dos Reis <gdr at open-axiom.net> wrote:
>> On Wed, Jun 22, 2011 at 3:19 AM, Gary Byers <gb at clozure.com> wrote:
>>> See <http://trac.clozure.com/ccl/ticket/871>.
>>> On Mon, 20 Jun 2011, Gabriel Dos Reis wrote:
>>>> Clozure CL returns an empty list on the following form
>>>> (handler-case (/ 1 0) (division-by-zero (c) (arithmetic-error-operands
>> This appears indeed to be fixed on x86-64.
> One more thing: on DIVISION-BY-ZERO signal, how many arguments should
> I expect? I (naively?) thought I would get two, but with the form
> (handler-case (log 0) (division-by-zero (c) (arithmetic-error-operands c)))
> I get only one. Two operands would have been more useful.
> -- Gaby
More information about the Openmcl-devel