On Sep 21, 2007, at 12:55 PM, Jason Grout wrote:
> > Robert Bradshaw wrote: >> >> Also, [10..1] now returns [10], it should probably return the empty >> list. What about [10,11,.,0]? Also the empty list? I think so. >> Thoughts? > > Well, it ought to go to infinity, wrap to negative infinity, and then > back up to zero, of course :). Just treat it like the one-point > compactification of the real line, going the long way around. :-) > > Should the following be valid? > > [10,20..15] for the list [10,20,19,18,17,16,15]. Currently, it would be [] as [10,20..100] would expand to [10,20,30,40,50,60,70,80,90,100] > > Perhaps there should be a distinction between [10,11,..,0] and > [10,11..0]. [10,11,..,0] is an error, while [10,11..0] is okay (i.e., > without the commas, the step is assumed to be 1 or -1). Hmm... the with vs. without commas is hard to see. Making [10,11,..,n] an error depending on the value of n is unsettling too. I've put another patch up on trac that handles empty ranges gracefully. Once can also write [0..10, step=2] now. - Robert --~--~---------~--~----~------------~-------~--~----~ 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-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---
