From: Nikolai Weibull Date: 2005-06-30T09:08:09+09:00 Subject: Re: shift vs. slice!(0) and others jason r tibbetts wrote: > Nikolai Weibull wrote: > > Eric Mahurin wrote: > > [...] > > >This sure would be nice for easy and high performance implementations > > >of circular and gap buffers. > > Please do explain, > > nikolai > "circular buffers" == deques, which are "circular" arrays--incrementing > past the end takes you to the beginning, etc. The "circular and gap buffers" construction was flawed. It should have been "circular and gapped buffers" or, even better, "circular buffers and gapped buffers". Deques are not necessarily implemented using arrays. A doubly linked list will do just as well (and doesn't have sizing issues). > But back to the original suggestion that delete_at() be implemented the > same way as shift(). The former makes it clear that the index in > question is being removed altogether, which will result in a > down-shifting of the array elements. shift() neither implies nor > requires that same constraint. Why would #delete_at(0) behaving as #shift be weird?, nikolai -- Nikolai Weibull: now available free of charge at http://bitwi.se/! Born in Chicago, IL USA; currently residing in Gothenburg, Sweden. main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}