"Levin Alexander" <levin / grundeis.net> writes: > Eric Mahurin <eric_mahurin / yahoo.com> wrote: > >> I agree. We should have shift for String. > > Disagree. What wold the semantics of String#shift be? > What would it shift? Bytes? Characters? Whatever String#[] and all the other String methods index, of course. > Words? Please --- don't be silly. > Lines? I still can't believe String#each does this by default. > There is no clear notion of an "Element" in a String. If this is true, then we have a serious problem. Before doing much anything about its API, we need to decide whether String is a byte array or a character array. (Presumably, matz & co. already have.) > You can always use split or implement shift > yourself if you need it for a particular application. Implementing an O(1) String#shift seems non-trivial to me. (Eric said he has done it, but did not yet post the code.) Anyway, this is irrelevant since, after all, you can implement most of the Ruby standard library yourself ``if you need it.'' -- Daniel Brockman <daniel / brockman.se> So really, we all have to ask ourselves: Am I waiting for RMS to do this? --TTN.