42 lines
2 KiB
HTML
42 lines
2 KiB
HTML
|
<!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN">
|
||
|
<!Converted with LaTeX2HTML 0.6.5 (Tue Nov 15 1994) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds >
|
||
|
<HEAD>
|
||
|
<TITLE>2.5.3. Bit-Vectors</TITLE>
|
||
|
</HEAD>
|
||
|
<BODY>
|
||
|
<meta name="description" value=" Bit-Vectors">
|
||
|
<meta name="keywords" value="clm">
|
||
|
<meta name="resource-type" value="document">
|
||
|
<meta name="distribution" value="global">
|
||
|
<P>
|
||
|
<b>Common Lisp the Language, 2nd Edition</b>
|
||
|
<BR> <HR><A NAME=tex2html1903 HREF="node33.html"><IMG ALIGN=BOTTOM ALT="next" SRC="icons/next_motif.gif"></A> <A NAME=tex2html1901 HREF="node29.html"><IMG ALIGN=BOTTOM ALT="up" SRC="icons/up_motif.gif"></A> <A NAME=tex2html1897 HREF="node31.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="icons/previous_motif.gif"></A> <A NAME=tex2html1905 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="icons/contents_motif.gif"></A> <A NAME=tex2html1906 HREF="index.html"><IMG ALIGN=BOTTOM ALT="index" SRC="icons/index_motif.gif"></A> <BR>
|
||
|
<B> Next:</B> <A NAME=tex2html1904 HREF="node33.html"> Hash Tables</A>
|
||
|
<B>Up:</B> <A NAME=tex2html1902 HREF="node29.html"> Arrays</A>
|
||
|
<B> Previous:</B> <A NAME=tex2html1898 HREF="node31.html"> Strings</A>
|
||
|
<HR> <P>
|
||
|
<H2><A NAME=SECTION00653000000000000000>2.5.3. Bit-Vectors</A></H2>
|
||
|
<P>
|
||
|
A bit-vector can be written as the sequence of bits contained in the
|
||
|
string, preceded by <tt>#*</tt>; any delimiter character, such as whitespace,
|
||
|
will terminate the bit-vector syntax.
|
||
|
For example:
|
||
|
<P><pre>
|
||
|
#*10110 ;A five-bit bit-vector; bit 0 is a 1
|
||
|
#* ;An empty bit-vector
|
||
|
</pre><P>
|
||
|
The bits notated following the <tt>#*</tt>, taken from left to right,
|
||
|
occupy locations within the bit-vector with increasing indices.
|
||
|
The leftmost notated bit is bit-vector element number 0, the next one
|
||
|
is element number 1, and so on.
|
||
|
<P>
|
||
|
The function <tt>prin1</tt> will print any bit-vector (not just a simple one)
|
||
|
using this syntax, but the function <tt>read</tt> will always construct
|
||
|
a simple bit-vector when it reads this syntax.
|
||
|
<P>
|
||
|
<HR>
|
||
|
<P><ADDRESS>
|
||
|
AI.Repository@cs.cmu.edu
|
||
|
</ADDRESS>
|
||
|
</BODY>
|