Since x>=0 returns unevaluated, the problem seems like it is with the
if statement, which is turning "maybe" into false. In Mathematica, the
if statement would return unevaluated  (for symbolic input into g).

On Apr 9, 9:18 pm, Carl Witty <[EMAIL PROTECTED]> wrote:
> I'd like to reopen discussion of #2781, "bool() for SymbolicEquation
> should raise an error when it doesn't know the answer".  Jason created
> a prototype patch to implement this, but gave up on it and closed the
> ticket when he was convinced that "this is not pythonic".
>
> I like the "raise an exception" behavior, because it would eliminate
> questions asking why form1 and form2 below are different (from this
> sage-support 
> threadhttp://groups.google.com/group/sage-support/browse_thread/thread/79d0...).
> (I have seen this exact problem at least twice on sage-support.)  What
> do you think?
>
> f(x)=x;
> def g(x):
>     if (x>=0):
>         return f(x)
>     else:
>         return f(-x);
>
> show(plot(g(x),(x,-1,1))) #form1
> show(plot(g,-1,1)) #form2
>
> Carl
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to