Re: rotatef mystery
- From: Pascal Bourguignon <pjb@xxxxxxxxxxxxxxxxx>
- Date: Thu, 30 Aug 2007 17:55:42 +0200
Ken Tilton <kennytilton@xxxxxxxxxxxxx> writes:
Saw this in the doc for rotatef, don't get it:
"If a place produces more values than there are store variables, the
extra values are ignored. If a place produces fewer values than there
are store variables, the missing values are set to nil. "
OK: (rotatef x y z)
How does a place, say, y produce more values than there are store
variables?!
kt
(defparameter *a* 1)
(defparameter *b* 1)
(defparameter *c* 1)
(defun fun () (values *a* *b* *c*))
(defun (setf fun) (val)
(setf *a* val
*b* (* val val)
*c* (* val val val))
(values *a* *b* *c*))
(define-symbol-macro y (fun))
Have fun!
(I don't know how y will behave in rotatef, no time now to find out).
--
__Pascal Bourguignon__ http://www.informatimago.com/
COMPONENT EQUIVALENCY NOTICE: The subatomic particles (electrons,
protons, etc.) comprising this product are exactly the same in every
measurable respect as those used in the products of other
manufacturers, and no claim to the contrary may legitimately be
expressed or implied.
.
- References:
- rotatef mystery
- From: Ken Tilton
- rotatef mystery
- Prev by Date: Re: Enforcing Syntax for function/macro
- Next by Date: Re: rotatef mystery
- Previous by thread: Re: rotatef mystery
- Next by thread: Re: rotatef mystery
- Index(es):
Relevant Pages
|