From: David Alan Black Date: 2002-07-06T05:09:29+09:00 Subject: Re: is there a better string.each? Hi -- On Sat, 6 Jul 2002, Tobias Reif wrote: > David Alan Black wrote: > > > > If you literally mean that String should be understood as inheriting > > all the methods from Array, then I think this is too rigid a picture. > > > stuff that's not shared could be undef'd, or not included I think there's more to some of the relationship between strings and arrays, though -- especially something like join/split, where what an array is join'ing itself into is a string. That makes me think there must be a hyper/meta/ur notion of stringhood, logically simultaneous with (not subsequent to) the notion of arrayhood. > > I've always thought that strings are basically arrays but merit > > certain kinds of special treatment, extra methods, optimizations > > (syntax as well as speed), etc., because they are so common that it's > > worth trading off some consistency (in their treatment as arrays) to > > make them easier to handle. > > > extra methods, sure; > wouldn't speed be more behind the scenes? Yes -- I was mainly thinking of optimizations or sugarizations of syntax (such as the "" constructor) David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav