#12801: substitute_function misses some substitutions
-----------------------------+----------------------------------------------
Reporter: nbruin | Owner: burcin
Type: defect | Status: positive_review
Priority: minor | Milestone: sage-5.0
Component: symbolics | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers: Michael Orlitzky
Authors: | Merged in:
Dependencies: #12796 | Stopgaps:
-----------------------------+----------------------------------------------
Comment (by nbruin):
Replying to [comment:7 mjo]:
> I'd like to look for a way to make it work for both
`substitute_function(g, sin)` and `substitute_function(g, 2*x)`,
Unfortunately, there is not enough information to make this work reliably.
If you do
{{{
expr=(c+1)*(y-1)
sin(x).substitute_function(sin,expr)
}}}
it needs to turn `(c+1)*(y-1)` into a function. Any of the following are
reasonable:
{{{
expr.function(y)
expr.function(c)
expr.function(y,c)
expr.function(c,y)
}}}
and all of them have a different result. This is actually the same reason
why "calling" expressions with positional arguments is deprecated.
If you're still doubting, try and figure out what
{{{
(f(x,z)+f(z,y)).substitute_function(f,cos(x)*sin(y+1))
}}}
should do.
Thanks for the doctest. Positive review it is.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12801#comment:9>
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 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/sage-trac?hl=en.