··········@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
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!"
···········@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!"
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