Jaap is right:

Compare

[EMAIL PROTECTED]
----------------------------------------------------------------------
| SAGE Version 2.9.3, Release Date: 2008-01-05                       |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------

sage: f(x) = -x

Exiting SAGE (CPU time 0m0.01s, Wall time 0m15.78s).

with

[EMAIL PROTECTED]
----------------------------------------------------------------------
| SAGE Version 2.9.3, Release Date: 2008-01-05                       |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------

sage: f(x) =-x
------------------------------------------------------------
   File "<ipython console>", line 1
<type 'exceptions.SyntaxError'>: can't assign to function call
(<ipython console>, line 1)


John

On 14/01/2008, Jaap Spies <[EMAIL PROTECTED]> wrote:
>
> William Stein wrote:
> > On 1/14/08, Jason Grout <[EMAIL PROTECTED]> wrote:
>
> >> I noticed that the following gives an error in Sage 2.9:
> >>
> >> sage: f(x)=-x
> >> ------------------------------------------------------------
> >>     File "<ipython console>", line 1
> >> <type 'exceptions.SyntaxError'>: can't assign to function call (<ipython
> >> console>, line 1)
> >>
> >> Is that a bug?  It seems to be related to the negative sign, since the
> >> following works:
> >>
> >> sage: f(x)=(-x)
> >> sage: f(2)
> >> -2
> >
> > Was there something funny about your x in the above example,
> > because it works fine for me:
> >
> > teragon:standard was$ sage
> > ----------------------------------------------------------------------
> > | SAGE Version 2.9.3, Release Date: 2008-01-05                       |
> > | Type notebook() for the GUI, and license() for information.        |
> > ----------------------------------------------------------------------
> >
> > sage: f(x) = -x
> > sage: f(2)
> > -2
> >
>
> Could it be related to the spaces around '='?
>
> Jaap
>
>
> >
>


-- 
John Cremona

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to