[Maxima] list of lists

Stavros Macrakis macrakis at alum.mit.edu
Mon Jun 1 14:53:14 CDT 2009


Depends where the elements are coming from.  If you know what they are in
advance, you can always write

   a: [ [c] , [d] ] $

Or you can do things like

    makelist( makelist(i,i,1,n), n, 1, 4)
           =>  [[1], [1, 2], [1, 2, 3], [1, 2, 3, 4]]

On Mon, Jun 1, 2009 at 3:49 PM, Adam Majewski <adammaj1 at o2.pl> wrote:

> Hi,
>
> I wanted to make array of list, but I failed to do it
> so I've tried to make list of lists ( if it is possible).
>
> Here is what I have done :
> 1. make a empty list
> a:[];
> 2. add elements to list ( another empty list)
> a:cons([],a);
> a:cons([],a);
> 3. add elements to sublists
> a[1]:cons(c,a[1]);
> a[2]:cons(d,a[2]);
> 4. check
> a[1][1];
>
> Is it a good/best way ?
>
> Adam
>
>
> ============== code ====================
> a:[];
> a:cons([],a);
> a:cons([],a);
> a[1]:cons(c,a[1]);
> a[2]:cons(d,a[2]);
> a[1][1];
> ==============================================
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20090601/39c99f8f/attachment.htm 


More information about the Maxima mailing list