17.05.2015 Views

zl:1 - FTP

zl:1 - FTP

zl:1 - FTP

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7 sys:%1d-aref<br />

I<br />

Current style suggests that you should use (Iocf (sys:%ld-aref ••• » instead<br />

of sys:%ld-aloc.<br />

When using sys:%ld-aloc it is necessary to understand how arrays are<br />

stored in memory: See the section "Row-major Storage of Arrays" in Converting<br />

to Genera 7.0.<br />

For an example of accessing elements of a multidimensional array as if it<br />

were a one-dimensional array: See the function sys:%ld-aref, page 7.<br />

sys:%ld-aref array index Function<br />

Returns the element of array selected by the index. sys:%ld-aref is the<br />

same as aref, except that it ignores the number of dimensions of the array<br />

and acts as if it were a one-dimensional array by linearizing the multidimensional<br />

elements. copy-array-portion uses this function.<br />

For example:<br />

(setq *array* (make-array '(2B 3B 5B») => #<br />

(setf (aref *array* 5 6 7) 'faa) => FOO<br />

;;; The following three forms have the same effect.<br />

(aref *array* 5 6 7) => FOO<br />

(sys:%1d-aref *array* (+ (* (+ (* 5 3B) 6) 5B) 7» => FOO<br />

(sys:%1d-aref *array* (array-row-major-index *array*» => FOO<br />

When using sys:%ld-aref it is necessary to understand how arrays are<br />

stored in memory: See the section "Row-major Storage of Arrays" in Converting<br />

to Genera 7.0.<br />

sys:%ld-aset value array index Function<br />

Stores value into the element of array selected by the index. sys:%ld-aset<br />

is the same as <strong>zl</strong>:aset, except that it ignores the number of dimensions of<br />

the array and acts as if it were a one-dimensional array by linearizing the<br />

multidimensional elements. copy-array-portion uses this function.<br />

Current style suggests that you should use (setf (sys:%ld-aref ••• » instead<br />

of sys:%ld-aset.<br />

When using sys:%ld-aset it is necessary to understand how arrays are<br />

stored in memory: See the section "Row-major Storage of Arrays" in Converting<br />

to Genera 7.0.<br />

For an example of accessing elements of a multidimensional array as if it<br />

were a one-dimensional array: See the function sys:%ld-aref, page 7.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!