On 2/18/2012 8:44 AM, Robert Dodier wrote:
> On 2/18/12, John Lapeyre<lapeyre.math122a at gmail.com> wrote:
>
>> I would like to tell Maxima how to format a particular lisp
>> struct. I notice that for lisp list expressions there are
>> some hooks that I don't understand. eg in nset.lisp.
> For 2-d display, Maxima gets the formatting function name as
> (GET (CAAR EXPR) 'DIMENSION) and then calls that.
> For 1-d display, the property is GRIND
>
> The display code is pretty obtuse. When I need a display function
> I always just copy an existing one and then modify that.
>
> That only works for ordinary Maxima expressions which have
> the form ((FOO) ...). If you have some other kind of expression,
> I guess it won't work; you'd have to hack src/displa.lisp or src/grind.lisp.
>
> best
>
> Robert Dodier
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
If your internal expression is a lisp list of random stuff, then the
obvious way
to deal with maxima's display (and almost everything else) is to tag it,
even
though YOU don't need the tag. Robert's suggestion is more like an
imperative.
If you make it ((my_special_tag) mystuff1 mystuff2 ....) then everything
else "works".
A more modern approach would be to use an object system (like CLOS) in which
each type of structure (= class) has a printing method.
Maxima's organization is more around functions (e.g. display, simplify) than
around objects (e.g. algebraic sum, matrix, ...)
RJF