According to the HyperSpec, ARITHMETIC-ERROR-OPERATION returns "a
list" of the offending operation, but a quick check with LispWorks,
AllegroCL, and SBCL shows that they all just return the operation
itself - which seems to make sense to me. Am I right to assume that
the "a list" part in the spec is just a copy-and-paste error that
nobody noticed?
ERRC 14 > (handler-case (/ 1 0)
(division-by-zero (c)
(arithmetic-error-operation c)))
/
Thanks,
Edi.
--
Lisp is not dead, it just smells funny.
Real email: (replace (subseq ·········@agharta.de" 5) "edi")
In article <·············@agharta.de>, Edi Weitz <········@agharta.de>
wrote:
> According to the HyperSpec, ARITHMETIC-ERROR-OPERATION returns "a
> list" of the offending operation, but a quick check with LispWorks,
> AllegroCL, and SBCL shows that they all just return the operation
> itself - which seems to make sense to me. Am I right to assume that
> the "a list" part in the spec is just a copy-and-paste error that
> nobody noticed?
I think so. Notice that in the Arguments and Values section it says
that <operation> is a function designator, not a list. And it makes
little sense to return a list when something will always be just a
single item.
--
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Edi Weitz wrote:
> According to the HyperSpec, ARITHMETIC-ERROR-OPERATION returns "a
> list" of the offending operation, but a quick check with LispWorks,
> AllegroCL, and SBCL shows that they all just return the operation
> itself - which seems to make sense to me. Am I right to assume that
> the "a list" part in the spec is just a copy-and-paste error that
> nobody noticed?
>
> ERRC 14 > (handler-case (/ 1 0)
> (division-by-zero (c)
> (arithmetic-error-operation c)))
> /
Dunno, but the function <arithmetic-error-operands> will get you (1 0).
CL-USER 44 >
(handler-case (/ 1 0)
(division-by-zero (c)
(arithmetic-error-operands c)))
(1 0)
Combining the two yields a complete list:
CL-USER 60 >
(handler-case (/ 1 0)
(division-by-zero (c)
(apply #'nconc (list (list (arithmetic-error-operation c))
(arithmetic-error-operands
c)))))
(/ 1 0)
So maybe it's a typo for <arithmetic-error-operation> since
<arithmetic-error-operands> *does* return a list.
Carl Taylor