From: skaller <sk...@us...> - 2004-09-11 19:01:12
|
On Sun, 2004-09-12 at 01:23, Brian Hurt wrote: > On Sat, 11 Sep 2004, Bardur Arantsson wrote: > > > I would have suggested "slice" just to be consistent with > > ExtString.String.slice, but since it uses the (index,len) > > approach instead of (first,last) and is also much stricter > > it might be confusing to use the same name. > > Actually, (first, last) would be easier to implement. Is there a > preference in the group? First,len has the advantage that the last node must be in the same list. However, first,last is probably more useful in some circumstances -- and works even when the two nodes are in a distinct list. So I can't decide. I think the semantics are sufficiently different to provide both. First,len can be implement by starting at first, advancing len, and then calling first,last. Or even use options ?first ?last ?len and treat all 3 being provided as requiring an assertion first + len = last to check the implied invariant. Hmmm... -- John Skaller, mailto:sk...@us... voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net |