On Sat, 28 Oct 2006 12:28:04 -0500, Joel B. Mohler  
<[EMAIL PROTECTED]> wrote:

>
> On Sat, Oct 28, 2006 at 02:18:56AM -0500, William Stein wrote:
>>
>> Hello,
>>
>> I implemented the idea that Bill Hart suggested this morning.  In the
>> next version of SAGE the following will work:
>
> What does the following do?
> sage: x=5
> sage: QQ['x']
> sage: print x
>
> IMO, it should give an exception indicating that x is already
> defined at the QQ['x'] line since a python programmer would not expect a
> new variable to be defined by that line.

It overwrites x.

> The actual results of
> sage:  QQ['x']
> sage:  GF(9)['x']
> also seem a bit uncomfortable.  I guess (in keeping with my opinion
> above) that the second line should throw the exception.  Somehow this
> seems like an annoying restriction, but I'm not sure.

Doing that might make the system unusable.  If you did

sage: MPolynomialRing(ZZ,'x',5)
Polynomial Ring in x0, x1, x2, x3, x4 over Integer Ring
sage: x2^2 + x3^3
x3^3 + x2^2
sage: MPolynomialRing(GF(7),'x',5)
Polynomial Ring in x0, x1, x2, x3, x4 over Finite Field of size 7
sage: x2^2 + x3^3
x3^3 + x2^2

With your model you would have to explicitly go through and delete
each of x0 x1 x2 etc, just because you decided to change rings.

----
I just spent a week with 50 serious algebraic geometry computation people,  
and
having
   sage: x = 5
   sage: QQ['x']
leave x equal to 5 really confuses them.  Anyway, a Python program would  
not
understand " QQ['x'] " since thats the notation for list indexing and in  
Python
it would return an element of QQ, I suppose.


William

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