#15025: automatically injected function does not work with desolve
------------------------------------+------------------------
       Reporter:  dkrenn            |        Owner:
           Type:  defect            |       Status:  new
       Priority:  major             |    Milestone:  sage-6.4
      Component:  symbolics         |   Resolution:
       Keywords:  desolve function  |    Merged in:
        Authors:                    |    Reviewers:
Report Upstream:  N/A               |  Work issues:
         Branch:                    |       Commit:
   Dependencies:                    |     Stopgaps:
------------------------------------+------------------------

Comment (by tmonteil):

 A similar problem was just hit on [http://ask.sagemath.org/question/25641
 /typeerror-in-creating-ode-variable/ this ask question].

 The bug is about wrong variable injection (the value injected into the
 Python variable does not correspond to the returned value, while it is
 claimed), not about `desolve`:

 {{{
 sage: z = function('y', x)
 sage: y
 y
 sage: z
 y(x)
 sage: y == z
 False
 sage: type(y)
 <class 'sage.symbolic.function_factory.NewSymbolicFunction'>
 sage: type(z)
 <type 'sage.symbolic.expression.Expression'>
 }}}

 Besides fixing this bug, i have nothing against removing automatic
 variable injection from Sage (which seems to concern only `var()` and
 `function()`), since it creates a lot of confusion between symbolic and
 Python variables among new users, for example we can see a lot of
 {{{var('n') ; n=2}}} on ask.sagemath.org, as if `var()` was a kind of
 variable declaration.

 As for the `NewSymbolicFunction` vs `Expression` issue depending on the
 arguments of `function()`, our options are:
 - create two distinct Python functions for the two situations,
 - deprecate the use of `function('y', x)`,
 - do not touch anything and provide a better documentation in the
 `function()` function.

 I like the second one since it goes towards better consistency. But, as
 for removing the ugly `var()` (or even the ugly `RR` that breaks the
 `RDF`, `RIF`, `RLF` naming scheme and causes meaningless discussions about
 whether `Infinity` or `NaN` belong to it), i expect not everyone to agree,
 even if this would help newcomers to grasp Sage's logic.

--
Ticket URL: <http://trac.sagemath.org/ticket/15025#comment:5>
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.

Reply via email to