Question: save, tables and names

November 27 2012 ErikP 70
Maple
0

Hello,

I just lost the result of a 20h calculation due to the last-name evaluation using tables. Consider that

t := table([1=2]):
s := t:
save s, "table":
restart:
read "table":
s[1];

evaluates to t[1]. The save command only stores that s is a reference to t, but does not save the actual table contents. Of course this is sensible as s really is just a reference to t, however it might be (certainly was for me) unexpected behaviour. Using s := eval(s) before the save helps of course.

However, the following is really a bug in my opinion. I used a procedure returning a table, e.g.

make := proc()
local result:
result := table([1=2]):
result:
end proc:
t := make():
save t, "table":
restart:
read "table":
t[1];

Now this evaluates to result[1], which makes no sense. Note that result is a local variable to the procedure and t itself the only name available to refer to this special instance of it. So save should in my opinion not store that "t refers to the result of some call to make()", which it does currently by only saving "t := result", but should store the table data eval(t) instead.

Any comments? At least in the second case I mentioned, the behaviour of save is completely useless and unexpected (giving t=result).

 

Thanks and best wishes,

Erik

Please Wait...