From: Martin DeMello Date: 2002-02-13T04:52:10+09:00 Subject: Re: [newbie] make first letter lowercase Dave Thomas wrote: > So, perhaps a better way might be to make the concept of exposing a > substring for manipulation orthogonal to that manipulation. Something > like: > str.expose!(1,2).upcase > str.expose!(5,6).tr('a', 'b') > We could then make it more generic: > ary.expose(2,-2)!.sort # sort all bug first and last elements > In general, this could probably be done as a mixin on all classes that > implement slices. I like this. Pity we can't have a []! operator to stand for general inplace modifications, though - I'd love to be able to write, frinstnace, a[0,2]!.upcase.sort and have the return value of everything after the !. modify the original. -- Martin DeMello