If a struct is defined and saved into a file:
defstruct(struct(a,b,c));
s:
[
new(struct([1,2,3],2,3)),
new(struct([4,5,5],5,6))
];
save("Test.lisp",s);
s[1]@a;
it can be loaded again within the same maxima session:
kill(s);
load("Test.lisp");
s[1]@a;
If maxima is restarted this doesn't work anymore, though:
load("Test.lisp");
s[1]@a;
in this case returns:
struct([1,2,3],2,3)@a
It seems like the struct isn't defined as a struct via defstruct() and new() but rather treated as a function with the struct elements as argument.
Found out why this did happen for me and documented it with commit #d0b2a1eacb1c2a47ed9bdef86c58bf9bdfc99851.
I'm reopening this bug report -- I just bumped into this problem. This is a bug in
save-- it should save the structure definition, as it also saves arrays, functions, properties, etc.When this bug is fixed, we can remove the text introduced in commit d0b2a1ea.
Thanks a lot! Don't know if there is a way to make maxima forget a struct's definition: That would feel like risking to delete the definition of an already-existing struct. If there is one I would be willing to write a few test cases.
Fixed by commit a5d1d3e. Closing this ticket.