[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Really kidding, now

(defsetf logand (x y) (newval)
  `(if (= (logand y newval) newval)
       (progn (setf ,x (logior newval
			       (logand (random (expt 2 (max (integer-length
				       (lognot y))))
       (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.)