Arguments and Values
mask-field performs a "mask" operation on integer. It returns an integer that has the same bits as integer in the byte specified by bytespec, but that has zero-bits everywhere else.
setf may be used with mask-field to modify a byte within the integer that is stored in a given place. The effect is to perform a deposit-field operation and then store the result back into the place.
(mask-field (byte 1 5) -1)
(defparameter *a* 15)
(mask-field (byte 2 0) *a*)
(setf (mask-field (byte 2 0) *a*) 1)