On Sep 17, 10:55 pm, "William Stein" <[EMAIL PROTECTED]> wrote: > And, if anybody out there thinks adding the above to the preparser > would make you positively cringe in disgust, please speak up! > (It doesn't mean we won't add it anyways...)
If you ask me, my opinion would be not to change it. If you ask why: Earlier, someone said that Range[10] in Mathematica gives you 1..10. While this is correct, it is also "incorrect". What is actually returned is: List[1,2,3,4,5,6,7,8,9,10] There are actually _eleven_ elements in the returned expression, because the head (List) is at index 0. The head can be edited just like the integers in the rest of the expression. For instance, this is a valid expression: 0[1,2,3,4,5,6,7,8,9,10] In a way, you could actually say that expressions (which include lists and arrays) in Mathematica are actually zero based. However, this fact has been neatly tucked away (hidden, basically) in almost all of the commands in Mathematica's function library. It is so pervasive that several functions take an option called Heads (which has an "intelligent" default) that controls whether or not the function operates on index zero. This behavior can be quite maddening at times, when one is wondering why a certain structure isn't located, only to find out it was inside a head. If sage is going to move to being contextually 1 based, but actually 0 based, which is basically what the proposal is asking for (and what Mathematica does), then people are going to start wanting this strange 1-off behavior everywhere... and you will have to design for it. Also, even with great care, it will still trip people up. It would probably make things more consistent and easier to learn if you stick with Python's convention. --~--~---------~--~----~------------~-------~--~----~ 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/ -~----------~----~----~----~------~----~------~--~---