Re: Maxima web interface



On 5/26/06, Matthew Sarnoff <msarnoff at andrew.cmu.edu> wrote:

> However, it seems that tex doesn't handle strings properly; tex("foo
> bar"); returns $$foo bar$$; I'd suggest wrapping them in \textrm or
> \texttt.

tex should return \mbox for strings (since r1.37 src/mactex.lisp).

> I have a suggestion for a "server-safe" mode that would make my life
> easier: the ability to "lock" variables such that they can't be redefined
> by the user. For example, my interface requires display2d to be nil so the
> output is properly captured; it would be great if I could prevent people
> from setting it to true.

It is not too difficult to make a variable read-only by using the
Lisp property system (and not too difficult to make it read-write
again, too). E.g.

?putprop ('display2d, ?neverset, ?assign);
display2d : false;
 => Improper value assignment to display2d

If there's enough interest in this we could make a function
dedicated to it, e.g. (defun $inhibit_assignment (x) (putprop ...))

> Aside from that, it'd be great to disable file I/O
> functions, lisp, and interactive integration. I'm not really familiar with
> the properties mechanism, but one idea might the ability to set
> "readonly" or "noexec" properties for "dangerous" variables/functions.

Well, attempting identify all troublesome functions seems messy,
and easily broken.
I'd rather approach this by imposing limitations from outside Lisp,
i.e. to have the operating system make the filesystem apparently
read-only and to put cpu and memory limits on the Maxima process.
Not sure what's workable here.

Robert Dodier