[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Error with multiple-value-setq...
- To: Nat Ballou <AI.BALLOU@MCC.ARPA>
- Subject: Error with multiple-value-setq...
- From: David D. Loeffler <Loeffler@MCC.ARPA>
- Date: Fri, 9 May 86 12:54 CDT
- Cc: slug@MCC.ARPA
- In-reply-to: The message of 8 May 86 21:10-CDT from Nat Ballou <AI.BALLOU@MCC.ARPA>
- Postal-address: 9430 Research Blvd., Echelon Bldg 1, Suite 200, Austin, TX 78759
- Reply-to: Loeffler@MCC.ARPA
Date: Thu 8 May 86 21:10:24-CDT
From: Nat Ballou <AI.BALLOU@MCC.ARPA>
Using Release 6.1, the following definition does not perform
correctly when compiled:
(defun foo (&aux a b) (multiple-value-setq (a b) (floor 3 2)) (list a b))
The function returns (1 1) when interpreted, but returns (1 NIL)
when compiled. Multiple-value-setq is common lisp, however, the
Zeta lisp form Multiple-value has the same problem.
Nat Ballou
MCC AI
-------
The problem is not with multiple-value-setq it is with floor
and other numeric functions that return 2 values.
If I write the function:
(defun foo1 ()
(floor 3 2))
The compiled and interpreted versions return one and two values respectively.
If foo3 and foo4 are defined:
(defun foo3 ()
(let (a b)
(multiple-value-setq (a b)
(foo4 3 4))
(list a b)))
(defun foo4 (x y)
(values y x))
Then you get the same result in both the interpreted and compiled versions.
-------