| Tom Plagge on Fri, 3 Dec 2004 16:00:01 -0600 (CST) |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| Re: [nimh-dev] More stuff |
> I think it will be easier if it's like this: > > 1. ['cur', 8, '9-11', 'foo'] > 2. [4, 8, '9-11', 7, '10-12'] # list remains flat > 3. [8, '9-11', 7, '10-12'] --> [(4, 5)] > 4. ['9-11', 7, '10-12'] --> [(4, 5), (8, 9)] > 5. [7, '10-12'] --> [(4, 5), (8, 12)] > 6. ['10-12'] --> [(4, 5), (7, 12)] > 7. [] --> [(4, 5), (7, 13)] > > Numeric tokens are popped off the first list and a second list of ranges > is created. > > But my brain has been warped by too many years of C++'s static > type-checking, so my preference may be due to my inability to think about > collections of different types. Either method would be easy to parse and interpret. I don't have strong feelings either way. This is kind of slick, I must admit. > No, it should store [1, 500] (or [1, 501]). Checking for existence later > on will keep the code cleaner. Upon further consideration, yes, I agree. ________________________________________________________________________ Tom Plagge UC Berkeley Physics Dept. 351 LeConte Hall Voice: (510) 643-1650 Berkeley, CA 94720 Email: tplagge@xxxxxxxxxxxxxxxxx ________________________________________________________________________ _______________________________________________ nimh-dev mailing list nimh-dev@xxxxxxxxxxx http://lists.ellipsis.cx/mailman/listinfo/nimh-dev