On Sat, Sep 6, 2008 at 9:22 AM, Martin Albrecht wrote:
>
>> >> sage: axiom(maxima('1/2'))
>> >>  1
>> >>  -
>> >>  2
>> >> sage: maxima(axiom('1/2'))
>> >> -1
>> > The only reason these examples work is by chance.  The current
>> > code was not designed to work this way, and this approach would
>> > only work in general for the simplest of examples (such as integers
>> > or rational numbers).
>>
>> That is not true. Exactly this sort of example was used to illustrate
>> the original design of Sage.
>
> AFAIK only interfaces Sage <-> $someothersystem are implemented
> and not $someothersystem <-> $yetanothersystem.

Yes. By definition that is the only way that Sage can operate. A
function like 'foo.get' takes something from Sage (a string) which it
will interpret in the external package foo and returns something (also
a string) which in principle may be interpretable in another package
(or Sage itself) although string manipulations such as substitutions
or other translations might be necessary. Functions more complicated
than 'get' of course could deal with more complex Sage objects than
strings but passing a linear string representation should be the
default.

> However, I think one could make it work like this:
>
> if isinstance(foo, ExpectElement) and not foo.parent() is self:
>  foosage = foo._sage_() # i.e. convert to Sage and then to the other
> system return self(foosage)
>

Yes, I think this is a good idea that allows the external interface to
be more intelligent.

Regards,
Bill Page.

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to