how to format foreign object?



>> For 1-d display, the property is GRIND

> A more modern approach would be to use an object system (like CLOS) in which
> each type of structure (= class) has a printing method.

Great, that was enough information to get something passable
with a mininum of hacking. The print-function
for structs is on the road to objects, but unless I'm mistaken
the maxima display code doesn't use it in an intelligent way
(the graph pacakge example I posted before comes from the
struct print-function).

A struct is an atom, so for display2d:false, I added a cond
clause just before the default in msize-atom that checks for
the struct with type-of. I then convert to a standard maxima
expression, but call msize-matchfix-aex that retrieves the
print symbols but appends an extra <>, or msize-function-aex
that replaces () with <>. Not really pretty, but I can see
what's happening.

(%i1) aex( f(1,2,3) );
(%o1) f<1,2,3>

(%i2) aex( [1,2,3] );
(%o2) <[1,2,3]>

(%i3) aex ( [ [a,b],  aex( set(x,y) ) ] );
(%o3) <[[a,b],<{x,y}>]>

John Lapeyre