From: ··········@gmail.com
Subject: An array of lists
Date: 
Message-ID: <f8d8f555-a92e-4a91-afe2-2a58278c4c5c@b1g2000hsg.googlegroups.com>
Is it possible to create an array of lists?  I'm trying but I just
can't figure it out...

From: Alberto Riva
Subject: Re: An array of lists
Date: 
Message-ID: <gcg61u$ho06$1@usenet.osg.ufl.edu>
··········@gmail.com wrote:
> Is it possible to create an array of lists?  I'm trying but I just
> can't figure it out...

 > (let ((a (make-array 3)))
     (dotimes (i 3)
       (setf (aref a i) (list i)))
     a)
#((0) (1) (2))

 > (aref * 1)
(1)

Alberto
From: Pascal J. Bourguignon
Subject: Re: An array of lists
Date: 
Message-ID: <87r66s71u0.fsf@hubble.informatimago.com>
Alberto Riva <·····@nospam.ufl.edu> writes:

> ··········@gmail.com wrote:
>> Is it possible to create an array of lists?  I'm trying but I just
>> can't figure it out...
>
>> (let ((a (make-array 3)))
>     (dotimes (i 3)
>       (setf (aref a i) (list i)))
>     a)
> #((0) (1) (2))
>
>> (aref * 1)
> (1)

If it's to make a vector: (vector (list 0) (list 1) (list 2))

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

"Our users will know fear and cower before our software! Ship it!
Ship it and let them flee like the dogs they are!"
From: Pascal J. Bourguignon
Subject: Re: An array of lists
Date: 
Message-ID: <87vdw471we.fsf@hubble.informatimago.com>
···········@gmail.com" <··········@gmail.com> writes:

> Is it possible to create an array of lists?  I'm trying but I just
> can't figure it out...

Perhaps because you didn't read the manual page for the MAKE-ARRAY
operator?

http://www.lispworks.com/reference/HyperSpec/Body/f_mk_ar.htm



(make-array (list 4 3)
            :initial-contents '(((a b) (c d) (e f))
                                ((g h) (i j) (k l))
                                ((m n) (o p) (q r))
                                ((s t) (u v) (w x))))
-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

"Our users will know fear and cower before our software! Ship it!
Ship it and let them flee like the dogs they are!"
From: Kenny
Subject: Re: An array of lists
Date: 
Message-ID: <48eba307$0$4982$607ed4bc@cv.net>
Pascal J. Bourguignon wrote:
> ···········@gmail.com" <··········@gmail.com> writes:
> 
> 
>>Is it possible to create an array of lists?  I'm trying but I just
>>can't figure it out...
> 
> 
> Perhaps because you didn't...

...realize that Lisp rocks the casbah so hard over treating all data 
equally: an array of lists is no different than an array of 42s.

ie, Just Do It(tm).

hth, kt
From: ··········@gmail.com
Subject: Re: An array of lists
Date: 
Message-ID: <a24cbf49-76d7-4779-809a-53cdb64c57af@a2g2000prm.googlegroups.com>
thanks.