On 1/14/08, John Cremona <[EMAIL PROTECTED]> wrote:
>
> Jaap is right:
>
> Compare

Excellent work tracking that down, which I would have never noticed.


sage: preparse('f(x) = x')
'_=var("x");f=symbolic_expression(x).function(x)'
sage: preparse('f(x) =+x')
'f(x) =+x'
sage: preparse('f(x) =-x')
'f(x) =-x'

This is now ticket #1776

   http://trac.sagemath.org/sage_trac/ticket/1776

 -- William

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


-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

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