#17531: allow algorithm keyword when calling BuiltinFunction
-------------------------------------+-------------------------------------
       Reporter:  rws                |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.5
      Component:  symbolics          |   Resolution:
       Keywords:  symbolic           |    Merged in:
  functions                          |    Reviewers:
        Authors:  Ralf Stephan       |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  eaed76a81b98c111bd77c05ccce745793e01b85e
  u/rws/allow_algorithm_keyword_when_calling_builtinfunction|     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by rws):

 Replying to [comment:13 kcrisman]:
 > Well, right, in this case it should just say "undefined keyword" or
 something!
 If you so insist, please help with the following design decision. We could
  * A) add a dictionary to the base class (`Function`) containing names of
 algorithms. The user (who writes subclasses of `Function`) may register
 names through subclass initialization. Unregistered names given in a
 `__call__` argument result in error.
  * B) make available the algorithm keyword only in a specific subclass of
 `Function`. The user would inherit from this subclass. Other existing
 classes retain their previous behaviour. The user is responsible to give
 an error in his class for unknown algorithms.
  * C) remove the algorithm keyword completely from any `__call__` method
 of `Function` or its subclasses. This means that the end user cannot say
 `f(10^6, algorithm=...)` but should be able to say `f(10^6,
 hold=True).n(algorithm=...)`. I don't know if this is easily possible at
 all. The function creator is responsible to give an error in his class for
 unknown algorithms.

 Granted, C does make some sense in that all numeric issues are moved into
 `_evalf_`, and it works around shortfalls of A or B. But the end user will
 hate it. With A, there is additional code (clutter) in `Function` and the
 subclass must register its algorithm names. With B, it's not a general
 `Function`-wide solution.

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