| www.delorie.com/gnu/docs/guile/guile_239.html | search |
![]() Buy GNU books! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Uniform arrays have elements all of the same type and occupy less storage than conventional arrays. Uniform arrays with a single zero-based dimension are also known as uniform vectors. The procedures in this section can also be used on conventional arrays, vectors, bit-vectors and strings.
When creating a uniform array, the type of data to be stored is indicated with a prototype argument. The following table lists the types available and example prototypes:
prototype type printing character #t boolean (bit-vector) b #\a char (string) a #\nul byte (integer) y 's short (integer) h 1 unsigned long (integer) u -1 signed long (integer) e 'l signed long long (integer) l 1.0 float (single precision) s 1/3 double (double precision float) i 0+i complex (double precision) c () conventional vector |
Unshared uniform arrays of characters with a single zero-based dimension are identical to strings:
(make-uniform-array #\a 3) => "aaa" |
Unshared uniform arrays of booleans with a single zero-based dimension are identical to bit-vectors.
(make-uniform-array #t 3) => #*111 |
Other uniform vectors are written in a form similar to that of vectors,
except that a single character from the above table is put between
# and (. For example, a uniform vector of signed
long integers is displayed in the form '#e(3 5 9).
#t if the obj is an array, and #f if not.
The prototype argument is used with uniform arrays and is described elsewhere.
make-uniform-array.
The optional arguments start and end allow a specified region of a vector (or linearized array) to be read, leaving the remainder of the vector unchanged.
uniform-array-read! returns the number of objects read.
port-or-fdes may be omitted, in which case it defaults to the value
returned by (current-input-port).
The optional arguments start and end allow a specified region of a vector (or linearized array) to be written.
The number of objects actually written is returned.
port-or-fdes may be
omitted, in which case it defaults to the value returned by
(current-output-port).
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |