From: Martin Glanvill
Subject: Displacing 2-D lisp array to 1-D array?
Date: 
Message-ID: <1994Mar30.195437.27101@waikato.ac.nz>
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

From: Karsten Poeck
Subject: Re: Displacing 2-D lisp array to 1-D array?
Date: 
Message-ID: <poeck-300394101715@wina65.informatik.uni-wuerzburg.de>
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
From: Barry Margolin
Subject: Re: Displacing 2-D lisp array to 1-D array?
Date: 
Message-ID: <2nfjvqINN4m3@early-bird.think.com>
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