Eric Mahurin <eric_mahurin / yahoo.com> writes:

> Daniel Brockman <daniel / brockman.se> wrote:
>
>> Who said there were no subtle differences between String and Array?
>> I would like that person to explain [why there is no String#shift].
>
> I agree.  We should have shift for String.  But, more importantly,
> slice!(0) and slice!(0,m) should be O(1) like Array#shift is.
> But, I've discussed this before in a previous thread.

Yes, I agree with this as well.

> I do have an implementation written in ruby for Array/String
> where all insertions/deletions at the front of are O(1),

I would like to see this implementation.  Particularly the Ruby
implementation of an O(1) String#shift.

> but this doesn't show its advantage until you get to about 50K
> elements or so.  This is because the ruby interpret time still
> dominates over the fast C copy until that many elements.
> But, after that point it is quite obvious.

-- 
Daniel Brockman <daniel / brockman.se>

    So really, we all have to ask ourselves:
    Am I waiting for RMS to do this?   --TTN.