Unexpected error
"Pierpaolo BERNARDI" <[email protected]> Fri, 09 Jun 2006 06:34:52 +0200
| Newsgroups | gmane.lisp.allegro |
|---|---|
| Message-ID | <op.tau20eqc8t8izc@eraora> |
Hello,
just trying acl 8.0 express.
With the following code:
(<-- (fa-rete ?l ?r ?v)
(append ?l1 ?l2 ?l)
(not (== ?l1 ()))
(not (== ?l2 ()))
(fa-rete ?l1 ?r1 ?v1)
(fa-rete ?l2 ?r2 ?v2)
(or (and (= ?r (ser ?r1 ?r2))
(is ?v (+ ?v1 ?v2)))
(and (= ?r (par ?r1 ?r2))
(is ?v (/ (+ (/ ?v1) (/ ?v2)))))))
(<- (fa-rete (?q) ?q ?q))
(defun ohm (resistori &optional (val-min 1d300))
(let ((rete-min))
(prolog (lisp ?lista resistori)
(and (fa-rete ?lista ?rete ?valore)
(lisp* (let ((val (abs (- ?valore pi))))
(when (< val val-min)
(setf val-min val
rete-min ?rete))))))
(values val-min rete-min)))
calling (ohm '(1 2 3 4 5 6 7 8 9 10)) most of the times works as intended.
However, it happened 2 times (out of about 10) that it signalled the
following errors:
Error: `#<unknown object of type number 2 @ #x20ebb952>' is not of the
expected type `NUMBER'
[condition type: TYPE-ERROR]
Error: `#<unknown object of type number 26 @ #x20eb4972>' is not of the
expected type `NUMBER'
[condition type: TYPE-ERROR]
(lisp-implementation-version) ==> "8.0 [Windows] (Jun 9, 2006 4:01)"
Cheers
P.