27 Oct
2013
27 Oct
'13
11:45 p.m.
Neal Becker wrote:
One thing I find unfortunate and does trip me up in practice, is that if you want to do a whole sequence up to k from the end:
u[:-k]
hits a singularity if k=0
I think the only way to really fix this cleanly is to have a different *syntax* for counting from the end, rather than trying to guess from the value of the argument. I can't remember ever needing to write code that switches dynamically between from-start and from-end indexing, or between forward and reverse iteration direction -- and if I ever did, I'd be happy to write two code branches. -- Greg