You are NOT wrong, your are right!

I used to have a lot of problems from students when Maple simplified
2(x+y) to 2 (at least it used to).

John

On 17/12/2007, William Stein <[EMAIL PROTECTED]> wrote:
>
> On Dec 17, 2007 5:32 AM, Joel B. Mohler <[EMAIL PROTECTED]> wrote:
> >
> > Hi,
> >
> > I don't think that the trac 1460 is really fixed.  The bug just got moved
> > around.
> > http://trac.sagemath.org/sage_trac/ticket/1460
> >
> > # sage 2.9
> > sage: t=var('t')
> > sage: f=t*sin(0)
> > sage: float(f(1))
> > # goes boom for a different reason than in 2.8.15
>
> This is *not* a bug.  The is by design.  Since f has no variables it
> is no longer
> implicitly callable:
>
> sage: f.variables()
> ()
> sage: f(1)
> .ValueError: the number of arguments must be less than or equal to 0
>
> You will have to instead write:
> sage: f(t) = t*sin(0)
> sage: f(1)
> 0
>
> or use
>
> sage: f=t*sin(0)
> sage: f(t=0)
> 0
>
> This change was introduced because people often do the following
> by accident:
>
> sage: a = (sqrt(2) + 17)(x+2)
> sage: a
> sqrt(2) + 17
>
> Of course, that the above doesn't give an error even in 2.9 is a
> bug!   At least in most cases it works:
>
> sage: (SR(2) + 3)(x)
> <type 'exceptions.ValueError'>: the number of arguments must be less
> than or equal to 0
>
> Also, this is a bug:
>
> sage: a = (I*17+3*5)(x+2)
> AttributeError: 'I_class' object has no attribute 'number_of_arguments'
>
>
> I want to emphasize that allowing
>
> sage: a = (sqrt(2) + 17)(x+2)
>
> and having it return sqrt(2) + 17 is *very* confusing to
> a lot of people.  I witnessed this time after time after time
> when teaching a high school workshop using Sage this
> summer -- it was really striking how often this happened.
>
> I made trac #1554 about this:
>   http://trac.sagemath.org/sage_trac/ticket/1554
>
> Joel -- thanks for your feedback, and please comment
> on the remarks I make above!  Maybe I'm just completely
> wrong?!
>
>  -- William
>
> >
> > It seems the originally submitted patch by was has a doc-test testing this 
> > very
> > thing, but the actual code in my newly upgraded 2.9 just has a bunch of
> > doc-strings that look like:
> > """
> > EXAMPLES:
> > """
> > with no examples!
> >
> > I'm not sure what went on beyond that.
> >
> > --
> > Joel
> >
> > >
> >
>
>
>
> --
> William Stein
> Associate Professor of Mathematics
> University of Washington
> http://wstein.org
>
> >
>


-- 
John Cremona

--~--~---------~--~----~------------~-------~--~----~
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://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to