From: Harry Ohlsen Date: 2002-07-09T13:57:24+09:00 Subject: Re: is there a better string.each? > Sorry, I guess I missed something. I didn't > realize that performance was an issue in this > discussion. I don't think the main thrust was performance. It's just that the split approach is potentially expensive memory-wise (for large strings). Obviously, it would be nice to have a mechanism that both worked and was as efficient as possible. ... Which I think is to have an each_char iterator, as Matz has said will be in 1.8, and which anyone who has written more than twenty lines of Ruby can whip up for themselves in the interim. > On a side note: As a rule, I think it's better > to write "interim" code in Ruby (and experiment > with it) before changing the core. That's not > to say that such a change is precluded forever. Amen. It would be sad to end up having to release a 1.8.1 five minutes later ... but, of course, I'd never expect Matz to make that mistake !! Harry O.