Stupid question, but is it possible to displace a m by n 2-D lisp array to a
m*n linear 1-D array (as per fortran)?
From Martin Glanvill
--===**| "Arm Powered" Dodo Breeder's Association of New Zealand Inc. |**===--
e-mail : ···@hoiho.math.waikato.ac.nz
********
snail-mail : c/- Dept Mathematics & Statistics *****/|*
University of Waikato ****/#|*
PO Box 3105 ***/__|*
Hamilton 2020 **/~~~|*
New Zealand ********
The art of being wise is the art of knowing what to overlook.
-- William James
In article <······················@waikato.ac.nz>, ···@waikato.ac.nz
(Martin Glanvill) wrote:
> Stupid question, but is it possible to displace a m by n 2-D lisp array to a
> m*n linear 1-D array (as per fortran)?
>
(defparameter *2d*
(make-array (list 3 4)
:initial-contents '((1 2 3 4)
(5 6 7 8)
(9 10 11 12))))
(defparameter *1d*
(make-array 12 :displaced-to *2d*))
Karsten
In article <······················@waikato.ac.nz> ···@waikato.ac.nz (Martin Glanvill) writes:
>Stupid question, but is it possible to displace a m by n 2-D lisp array to a
> m*n linear 1-D array (as per fortran)?
Yes. See the :DISPLACED-TO option to MAKE-ARRAY.
--
Barry Margolin
System Manager, Thinking Machines Corp.
······@think.com {uunet,harvard}!think!barmar