From: Tobias Reif Date: 2002-07-06T05:27:49+09:00 Subject: Re: is there a better string.each? David Alan Black wrote: > 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. just to show that irb(main):007:0> res = '123'.split(''); p res; puts res.class ["1", "2", "3"] Array nil irb(main):008:0> res = [1,2,3].join; p res; puts res.class "123" String nil > That makes me think there > must be a hyper/meta/ur notion of stringhood, logically simultaneous > with (not subsequent to) the notion of arrayhood. Returning an object of the parent or child class is not contradicting that relationship. If a string is a special case of an array and is modeled as a subclass, then an array can still return a string and vice versa. (or did I misunderstand you) But really, this [word-class]#each thing bugs me more :) > Yes -- I was mainly thinking of optimizations or sugarizations of > syntax (such as the "" constructor) "" as short for String.new; I agree, that's nice... Tobi -- http://www.pinkjuice.com/