User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

cl:functions:bit [2019/09/14 05:00]
cl:functions:bit [2019/11/15 12:00] (current)
Line 1: Line 1:
 +====== Accessor BIT, SBIT ======
 +
 +====Syntax====
 +  * **bit** //bit-array ''&​rest''​ subscripts//​ → //​bit// ​
 +  * **sbit** //bit-array ''&​rest''​ subscripts//​ → //​bit// ​
 +  * (**setf** (**bit** //bit-array ''&​rest''​ subscripts//​) //​new-bit//​) ​
 +  * (**setf** (**sbit** //bit-array ''&​rest''​ subscripts//​) //​new-bit//​)
 +
 +====Arguments and Values====
 +  * //​bit-array//​ - for **bit**, a //​[[CL:​Glossary:​bit array]]//; for **sbit**, a //​[[CL:​Glossary:​simple bit array]]//.
 +  * //​subscripts//​ - a //​[[CL:​Glossary:​list]]//​ of //​[[CL:​Glossary:​valid array index|valid array indices]]// for the //​bit-array//​.
 +  * //bit// - a //​[[CL:​Glossary:​bit]]//​.
 +
 +====Description====
 +**bit** and **sbit** //​[[CL:​Glossary:​access]]//​ the //​bit-array//​ //​[[CL:​Glossary:​element]]//​ specified by //​subscripts//​.
 +
 +These //​[[CL:​Glossary:​function|functions]]//​ ignore the //​[[CL:​Glossary:​fill pointer]]// when //​[[CL:​Glossary:​access|accessing]]//​ //​[[CL:​Glossary:​element|elements]]//​.
 +
 +====Examples====
 +<​blockquote>​
 +([[CL:​Macros:​defparameter]] *bit-array* ​
 +  ([[CL:​Functions:​make-array]] 8 :​element-type '​[[CL:​Types:​bit]] ​
 +                :​initial-element 1)) <​r>​*BIT-ARRAY*</​r>​
 +(bit *bit-array* 3) <r>1 </r>
 +([[CL:​Macros:​setf]] (bit *bit-array* 3) 0) <r>0 </r>
 +(bit *bit-array* 3) <r>0 </r>
 +(sbit *bit-array* 5) <r>1 </r>
 +([[CL:​Macros:​setf]] (sbit *bit-array* 5) 1) <r>1 </r>
 +(sbit *bit-array* 5) <r>1 </r>
 +</​blockquote>​
 +
 +====Affected By====
 +None.
 +
 +====Exceptional Situations====
 +None.
 +
 +====See Also====
 +**[[CL:​Functions:​aref|Function AREF]]**, {\secref\ConstantModification}
 +
 +====Notes====
 +**bit** and **sbit** are like **[[CL:​Functions:​aref]]** except that they require //arrays// to be a //​[[CL:​Glossary:​bit array]]// and a //​[[CL:​Glossary:​simple bit array]]//, respectively.
 +
 +**bit** and **sbit**, unlike **[[CL:​Functions:​char]]** and **[[CL:​Functions:​schar]]**,​ allow the first argument to be an //​[[CL:​Glossary:​array]]//​ of any //​[[CL:​Glossary:​rank]]//​.
 +
 +\issue{CONSTANT-MODIFICATION:​DISALLOW}