From: Yury Sulsky
Subject: select array dimensions
Date: 
Message-ID: <pan.2004.10.26.02.01.16.358387@nyu.edu>
Hi,

I'm looking for an equivalent to lush's (http://lush.sf.net) "select"
function in common lisp:

(select m n s) ==> returns an array with the n-th dimension removed, and
which is the s-th slice of m in the n-th dimension.
(setq m #((0  1  2  3  4)
          (10 11 12 13 14)))
(select m 1 2) ==> #(2 12)

Is there anything like scheme's make-shared-array in common lisp that
could be used for this?

Thanks!
Yury
From: Barry Margolin
Subject: Re: select array dimensions
Date: 
Message-ID: <barmar-BD5FF2.22492925102004@comcast.dca.giganews.com>
In article <······························@nyu.edu>,
 Yury Sulsky <····@nyu.edu> wrote:

> Hi,
> 
> I'm looking for an equivalent to lush's (http://lush.sf.net) "select"
> function in common lisp:
> 
> (select m n s) ==> returns an array with the n-th dimension removed, and
> which is the s-th slice of m in the n-th dimension.
> (setq m #((0  1  2  3  4)
>           (10 11 12 13 14)))
> (select m 1 2) ==> #(2 12)
> 
> Is there anything like scheme's make-shared-array in common lisp that
> could be used for this?

Lisp Machine Lisp has "conformally displaced arrays", which allow you to 
create 2-D array that's displaced to a rectangular portion of another 
2-D array.  But Common Lisp doesn't have anything like this.  It was 
created specifically to support the needs of the LispM window system -- 
a window could be displaced to the appropriate area of the frame buffer 
memory.

-- 
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***