#8734: make sage variables unique in maxima
-------------------------------------+-------------------------------------
Reporter: jason | Owner: jason
Type: defect | Status: needs_work
Priority: major | Milestone: sage-6.2
Component: interfaces | Resolution:
Keywords: | Merged in:
Authors: Jason Grout, Ralf | Reviewers: Volker Braun
Stephan | Work issues:
Report Upstream: N/A | Commit:
Branch: | be9367f966fc76ba6028b57ab4317530cfd1205e
u/rws/ticket/8734-1 | Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by rws):
As far as I understand now, a `MaximaElementFunction` is a function
defined within the Maxima process, and so `x` is the parameter name, not a
registered variable. Thus the output `sin(x)` makes sense. OTOH any
`_SAGE_VAR_x` that appears in a `MaximaElement` repr refers to a
registered variable within Maxima that is associated with a registered
Sage var named `x`. Let's interpret the above output in the light of this.
> {{{
> sage: f+g
> cos(_SAGE_VAR_x)+sin(x)
> }}}
Correct but can the user make sense of it?
> {{{
> sage: (f+g)(2)
> cos(_SAGE_VAR_x)+sin(2)
> }}}
That is not less correct than
{{{
sage: (sin(x)+cos(y))(2)
cos(y) + sin(2)
}}}
and it just seems to be another case of `SR._call_element_()` where is
stated: "Note that you make get unexpected results when calling symbolic
expressions and not explicitly giving the variables."
Moreover, it was a hack that this worked at all in the
`MaximaAbstractElementFunction._add_()` doctests because
{{{
sage: f = maxima.function('z','sin(z)')
sage: f
sin(z)
sage: f(2)
sin(2)
sage: (sin(z))(2)
---------------------------------------------------------------------------
NameError Traceback (most recent call
last)
NameError: name 'z' is not defined
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/8734#comment:27>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.