On Sun, Aug 2, 2009 at 9:13 AM, Robert Dodier<[email protected]> wrote:
>
> Robert Bradshaw wrote:
>
>> Sage lists are Python lists, which are very different than
>> Mathematica lists.
>
> You say that as if it's a fact of geography which can't be changed.
>
>> to change all lists would be a massive (backwards-
>> incompatible) change, as well as another step away from Python.
>
> Not exactly. At present something like 1 + [2, 3, 4, 5] causes Python
> to cough up an error, right? So extending arithmetic operators to
> lists wouldn't change the behavior of any existing Python program.
> (I'm not worried that someone might have written a program which
> requires an error to be triggered when number + list is encountered.)

Unfortunately for your suggestion, arithmetic operators are methods of
the objects.  To make "1 + [2,3,4,5]" and "[2,3,4,5] + 1" not raise an
exception would require changing the Python interpreter itself, at the
C level.

>
> You could even pitch it in algebraic terms. The set of lists comprises
> an ideal in the ring of ... well, of something. Maybe the ring of
> all numbers and lists. Anyway maybe that would appeal to someone
> with an algebraic state of mind.
>
>> Of course, we support all of this without numpy as well.
>>
>> sage: a0 = vector([1,2,3,4])
>
> That's not enough. Only vector + vector, scalar * vector, and
> inner product are defined, right? I'm pretty sure users would
> like to see vector * vector, vector ^ exponent, scalar / vector, etc.
>
> With all that said, Mathematica is more than a little confused
> about lists --- there is no distinction between lists and sets, and
> a matrix is just a list of lists. That's a mess, which Sage shouldn't
> duplicate. But arithmetic on lists isn't confusing.

Agreed. We definitely didn't duplicate that lack of structure in Sage.

>
> FWIW
>
> Robert Dodier
>
> >
>



-- 
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://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to