[Maxima] Maxima: simplification function error message.
robert.dodier at gmail.com
Tue Sep 11 22:03:22 CDT 2007
On 9/11/07, Stavros Macrakis <macrakis at alum.mit.edu> wrote:
> 1) In Maxima's current string implementation (using Lisp symbols),
> strings are never garbage collected (!!). This means that once you've
> taken space for a given string, that space is never reclaimed. When
> we eventually move to a Lisp-string based implementation, this problem
> will go away.
I have spent some time working on patches to make it possible
to use Lisp strings as Maxima strings. There are various aspects
of this task.
(1) Some Maxima strings have properties, namely operator names
like "+" "*" etc. The only property which matters is OPR. (Some
strings have TeX properties but those don't matter, because the
TeX properties which matter are those of the associated MPLUS
MTIMES etc.) I've expanded the existing function GETOPR to
recognize a Lisp string as well as a Lisp symbol. The values which
are attached to the OPR property of Maxima strings at present
are stored in a hash table for which the keys are Lisp strings.
I don't know if that's optimal but it works OK. I have not
committed this GETOPR stuff.
(2) Literal Maxima strings (i.e. symbols like |&Some error message|)
have been changed to (MAKE-MSTRING "Some error message")
which creates a symbol at present but can be switched to a Lisp
string when we're ready for it. These MAKE-MSTRING calls are
already in the source code (and have been for a while).
(3) The parser needs to be changed to parse "..." into a Lisp
string instead of a Lisp symbol. Looking at the code, it looks
like some minor modifications to SCAN-STRING and friends
might be enough. I haven't worked on that yet.
(4) There are a few functions for working with Maxima strings.
MSTRING, MSTRINGP, and MAKE-MSTRING come to mind.
There might be others. Those functions would have to be modified.
Also various functions in share/contrib/stringproc.
There might be other bits of code which expect Maxima strings to be
Lisp symbols but nothing comes to mind at the moment.
I'm sure to find them the hard way. I'll keep plugging away.
More information about the Maxima