Bill Page wrote:
>
> Ooops, I forget to complete this thought in my last message:
>
> On Fri, Sep 5, 2008 at 10:14 PM, Bill Page wrote:
> > On Fri, Sep 5, 2008 at 6:51 PM, Mike Hansen wrote:
> >>
> >> I actually removed the use of unparse and InputForm in the latest
> >> changes because of things like
> >>
> >> (6) -> unparse(2.123 :: InputForm)
> >>
> >> (6) "float(156649750673941512323,-66,2)"
> >> Type:
> >> String
> >>
> >> which is not quite what we want for the Sage interface.
> >
> > I think it is not so bad since by defining the function float
> > appropriately this can easily parse this into a Sage floating
> > point. If this really is inconvenient then the ...
> >
>
> I think the best way to solve this problem is to adapt "unparse" to
> produce a more commonly employed linear format. This is a correction
> that can be considered upstream by the FriCAS developers. But in the
> mean time the Sage interface can apply a temporary fix.
>
I wonder why you want unpase: unparse produces infix form. If you
want to build Sage expression you need to parse it. Fully parenthesised
form like S-expression is much easier to parse. Have you looked at:
PRETTYPRINT((x^2+15)::INFORM)$Lisp
PRETTYPRINT((matrix [[1, 2], [3, 4]])::INFORM)$Lisp
PRETTYPRINT((integrate(exp(sqrt(x^3-1)), x))::INFORM)$Lisp
If you or Sage folks do not like Lisp form it is rather easy
to produce something like:
+(^(x,2),15)
or
(((x)^(2))+15)
BTW: for unparse it is bad idea to transmit float as strings.
Namely, parsing result of unparse is supposed to give "equivalent"
expression. But printing a float and reading it back is likely
to mangle the value.
--
Waldek Hebisch
[EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/fricas-devel?hl=en
-~----------~----~----~----~------~----~------~--~---