#20312: parent of argument lost with Functions
-------------------------------------+-------------------------------------
       Reporter:  rws                |        Owner:
           Type:  defect             |       Status:  new
       Priority:  major              |    Milestone:  sage-7.2
      Component:  symbolics          |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Ralf Stephan       |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/rws/parent_of_argument_lost_with_functions|  
eb5bf9367e1f781b6a5e649f4be6fe0fa4da2c39
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------
Changes (by {'newvalue': u'Ralf Stephan', 'oldvalue': ''}):

 * commit:   => eb5bf9367e1f781b6a5e649f4be6fe0fa4da2c39
 * author:   => Ralf Stephan


Comment:

 It looks like the first version here can handle the binomial example of
 #20060 as well as the symbolic poly functions. It works by adding a field
 `_preserved_arg` to every `BuiltinFunction` that is set on function
 creation and says which of the function arguments is the one where we try
 to preserve the arg's parent. Then `Expression.polynomial()` is used to
 convert back in case of polynomial rings. Also, by not setting a default
 `preserved_arg` the functionality is limited to the cases where the
 developer has given this parameter in the function init call.

 This does not work however with the title example because there the
 functions are nested. Since it seems we cannot decide where in a nested
 expression the specific element is whose parent we want to preserve I tend
 to exclude the nested case.
 ----
 New commits:
 
||[http://git.sagemath.org/sage.git/commit/?id=eb5bf9367e1f781b6a5e649f4be6fe0fa4da2c39
 eb5bf93]||{{{20312: preserving function arg parent, first version}}}||

--
Ticket URL: <http://trac.sagemath.org/ticket/20312#comment:6>
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 https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to