User Tools


Accessor BIT, SBIT

Syntax

  • bit bit-array &rest subscriptsbit
  • sbit bit-array &rest subscriptsbit
  • (setf (bit bit-array &rest subscripts) new-bit)
  • (setf (sbit bit-array &rest subscripts) new-bit)

Arguments and Values

Description

bit and sbit access the bit-array element specified by subscripts.

These functions ignore the fill pointer when accessing elements.

Examples

(defparameter *bit-array* (make-array 8 :element-type 'bit :initial-element 1))

*BIT-ARRAY*

(bit *bit-array* 3)

1

(setf (bit *bit-array* 3) 0)

0

(bit *bit-array* 3)

0

(sbit *bit-array* 5)

1

(setf (sbit *bit-array* 5) 1)

1

(sbit *bit-array* 5)

1

Affected By

None.

Exceptional Situations

None.

See Also

Function AREF, {\secref\ConstantModification}

Notes

bit and sbit are like aref except that they require arrays to be a bit array and a simple bit array, respectively.

bit and sbit, unlike char and schar, allow the first argument to be an array of any rank.

\issue{CONSTANT-MODIFICATION:DISALLOW}