On May 21, 2005 10:00 PM William Sit wrote:

> ...
> For example:
>
>(26) -> )lisp (|parseAndInterpret| "expand((1+x)^10)::OutputForm")
>
>   (26)
>    10      9      8       7       6       5       4       3      2
>   x   + 10x  + 45x  + 120x  + 210x  + 252x  + 210x  + 120x  + 45x  +
10x + 1
>                                                             Type:
OutputForm
> ...
> You want two lines:
>
>    10      9      8       7       6       5       4       3      2
>
> and 
>
>   x   + 10x  + 45x  + 120x  + 210x  + 252x  + 210x  + 120x  + 45x  +
10x + 1

Yes, that's it exactly.

> Back to the drawing board.
>
> The print command in Axiom always returns void. Wouldn't that
> mean one has to intercept the side-effect of printing? But that
> can happen anywhere in the code. Right?

Well I am assuming (without checking deeply in the code) that
although creating the OutputForm is distributed throughout
the algebra code, rendering of the OutputForm as 2-dimensional
text by this thing called CHARYBDIS, is likely done in only one
place. My hope is that the 2-d array of characters is available
internally in it's entirety, before it is sent to stdout, line-
by-line. This is what I need to send to the http stream, along
with other things required by the hypertext protocol.
 
> Would it be easy to write a Java script to parse the prefix
> lisp output string in Value? This can then take care of the
> window width as well.

Well yes, I like your approach to returning latex output.

> A better way for TeX output:
>
>(18) -> )lisp (|parseAndInterpret|
"tex(integrate(sin(x),x)::TexFormat)")
>
>   (18)  ["-{\cos \left( {x} \right)}"]
>                                               Type: List String
> Value = ((|List| (|String|)) WRAPPED "-{\\cos \\left( {x} \\right)}")

I think I can use that in at least a limited way, although it
would be nicer if I did not have to wrap the command in
  tex( ... ::TexFormat)
and even better if this would work for multi-line input
of the sort one can process by

  )read file.input

But I don't think that using Java script in the browser to
parse the "prefix lisp output string" would be that practical.
As I understand it that would amount to re-implementing
CHARYBDIS on the browser side in java which is beyond the
level of effort that I was hoping for. If one was to attempt
something on this scale, I think it would be better to go
directly to MathML based on the prior NAG work on openmath.
Or as an interim approach, via LaTeX code, calling latex and
dvipng as external program to obtain a graphic result.

Regards,
Bill Page.




_______________________________________________
Axiom-developer mailing list
Axiom-developer@nongnu.org
http://lists.nongnu.org/mailman/listinfo/axiom-developer

Reply via email to