----- Original Message -----
From: "Rudolf Polzer" <denshimeiru-sapmctacher / durchnull.ath.cx>
Newsgroups: comp.lang.ruby
To: "ruby-talk ML" <ruby-talk / ruby-lang.org>
Sent: Thursday, August 07, 2003 2:26 PM
Subject: Re: Elegant solution for a loop-break problem


> Scripsit ille ?Brian Candler? <B.Candler / pobox.com>:
> > In Ruby:
> >
> >     l = %w{one two three}
> >     l.each do |elem|
> >       elem.replace('X' + elem.upcase)
> >     end
> >     p l
> >
> > In other words, you have to mutate the existing element; assigning to
'elem'
> > does not replace the element, it simply makes the local variable point
> > elsewhere.
>
> Yes, that is exactly the problem.

You might search for a post of mine a few months back
where I mentioned my idea of a "super-iterator" that
would work around this problem (and two or three others).

Hal

--
Hal Fulton
hal9000 / hypermetrics.com