On Thursday, July 30, 2015 at 1:21:21 PM UTC-7, David Roe wrote:
>
> > Moreover, do we really want 
> > 
> > sage: log(QQ(8), 2).parent() 
> > Integer Ring 
>
> I would say yes.  For rational x which is not a power of 2, log(x, 2) 
> will end up in the symbolic ring.  But we should avoid this if 
> possible, and the only logs which are rational will actually be 
> integral, so we might as well have Integer Ring as the parent. 
> David 
>

Please try to let the parent of the result depend only on the parents of 
the arguments (i.e., codomain is determined by signature). I'm aware that 
this is not always possible, but in this case I think it is.

It's extremely annoying if your code breaks in subtle ways because a *type* 
of an intermediate result is subtly affected by a different *value* of a 
parameter. For interactive use this isn't so bad, because you will usuall 
*look* at the result you get back and decide your next step on that. 
However, for more automated work (and the whole power of a system like sage 
is that you can first try something interactively and then, with minimal 
changes, wrap it up into an automated procedure) it is a complete pain.

I remember from programming in maple that at least two thirds of my code 
ended up consisting of checks to catch the different types of values a 
particular routine could produce and then massaging that into a suitable 
form for input into the next routine. I did not enjoy that.

-- 
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