write_data - problem with brackets



Rafa? Topolnicki wrote:
> Hi,
>
> I got problem with write_data and expressions containing brackets:
>
> (%i1) L:makelist([i,sin(i)],i,0,3);
> (%o1)           [[0, 0], [1, sin(1)], [2, sin(2)], [3, sin(3)]]
> (%i2) write_data(L,"tmp.dat");
> (%o2)                                done
> (%i3) N:read_list("tmp.dat");
> (%o3)      [0, 0, 1, sin, (, 1, ), 2, sin, (, 2, ), 3, sin, (, 3, )]
> (%i4) N:read_nested_list("tmp.dat");
> (%o4)  [[0, 0], [1, sin, (, 1, )], [2, sin, (, 2, )], [3, sin, (, 3, )]]
> (%i5) M:read_matrix("tmp.dat");
>
> All matrix rows are not of the same length.
>   -- an error.  To debug this try debugmode(true);
>
> what should I do read this file correctly?
>
> Maxima 5.18.1 http://maxima.sourceforge.net
> Using Lisp SBCL 1.0.30
> Linux
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>   
I think you should just do

save("tmp", L);

and in some other copy of maxima you can do

load("tmp")

which will redefine L.

I think write_data is for sending data to programs like Excel.