[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Really kidding, now
- To: common-lisp@SU-AI
- Subject: Really kidding, now
- From: Guy.Steele@CMU-CS-A
- Date: Thu, 06 Oct 1983 08:26:00 -0000
(defsetf logand (x y) (newval)
`(if (= (logand y newval) newval)
(progn (setf ,x (logior newval
(logand (random (expt 2 (max (integer-length
,newval)
(integer-length
,y))))
(lognot y))))
,newval)
(error "Impossible setf.")))
So then when you say
(setf (logand x 12) 8)
x will get set to some random value such that when it is anded with
12 you will get 8. (X might get set to 9 or 10, for example.)
--Guy