Emmanuel Charpentier <emm.charpentier at free.fr> writes:
> /* Original result */
>
> (%i5) tex(transpose(A));
> $${\it transpose}\left(A\right)$$
> (%o5) false
>
> /* Replacement function */
>
> (%i6) transposeput(e):=block([foo],
> foo:lambda([x],
> if length(x)=1
> then tex1(first(x))
> else concat(tex1(first(x)), ",",
> foo(rest(x)))),
> concat("\\mathrm{t}\\left(",
> foo(args(e)),
> "\\right)"));
> (%o6) transposeput(e) := block([foo], foo :
> lambda([x], if length(x) = 1 then tex1(first(x))
> else concat(tex1(first(x)), ",", foo(rest(x)))),
> concat("\mathrm{t}\left(", foo(args(e)), "\right)"))
>
> /* Hook it in place */
>
> (%i7) texput(transpose, transposeput);
> (%o7) transposeput
>
> /* Test it */
>
> (%i8) tex(transpose(A));
> $${\it transpose}\left(A\right)$$
> (%o8) false
>
> /* The original definition is still used. Putting debugging print()
> statements in the function shows that it is never called... */
Tracing through the function execution, I see that in the TEX1 function
(mactex.lisp), we change the '(($TRANSPOSE) $a)) to its verb form:
(%i26) :lisp (meval '(($TRANSPOSE) $a))
((%TRANSPOSE SIMP) $A)
when we call MEVAL in line 148.
As a result, the TEX function (which actually checks the property that
you can set with texput) doesn't check the plist of $TRANSPOSE, but
rather that of %TRANSPOSE.
Tricks like "texput(verbify(transpose), transposeput);" don't seem to
work here, unfortunately, and I don't really know this code at all so I
don't know how to suggest a solution for what you want to do. I'm also
not sure what the behaviour is supposed to be!
Barton Willis and Robert Dodier seem to have made significant changes to
the relevant file, so they might be able to chip in with something more
helpful.
Rupert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 315 bytes
Desc: not available
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20111225/17e9b1fb/attachment-0001.pgp>