On Tuesday, May 26, 2015 at 10:15:02 PM UTC+2, David Einstein wrote:
>
> ... is the expected interface for classes that inherit from 
> BuiltinFunction documented somewhere.  The ones I know about are listed in 
> the code for BuiltinFunction._register_function, but don't seem to be 
> documented.  For example, I believe that _evalf is supposed to be the 
> numerical evaluation function, but do not have a clear understanding of 
> what types it is expected to return, what exceptions it is expected to 
> raise, etc.  
>

First, some information can be gained from the symbolic functions wiki page:
http://trac.sagemath.org/wiki/symbolics/functions

The most recently closed tickets and many of those needing work can be
seen as example for good practice, because they were under scrutiny of
the usual suspects regarding symbolics. 
 

> While looking at #15786 with an eye to understanding the architecture of 
> sage, I noticed the following comment before the __call__ method of 
> Function_ceil and Function_floor.
>
> #FIXME: this should be moved to _eval_
>
... 

> Unfortunately, if we move all of the code from Function_ceil.__call__ to 
> Function_ceil._eval_ then the call to BuiltinFunction.__call__ will then 
> call Function_ceil._eval_ and we are on the way to infinite recursion.  We 
> cannot call BuiltinFunction._eval_, because BuiltinFunction does not 
> implement _eval_.
> Is there some way to avoid this recursion?
>

I don't think there is actually this problem because Jeroen Demeyer has 
included some
neat tricks in BuiltinFunction that prevent this. Note that 
BuiltinFunction.__call__ also
may call Function.__call__ which has complicated logic.

 What is the problem with overloading __call__?
>

I was convinced by Jeroen that it's not necessary. I cannot point to his 
exact argument
at the moment, sorry.

Regards, 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" 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-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to