From: "Hal E. Fulton" Date: 2003-06-04T13:37:39+09:00 Subject: Re: case of sub! not working ----- Original Message ----- From: "Ian Macdonald" To: "ruby-talk ML" Sent: Tuesday, June 03, 2003 11:30 PM Subject: Re: case of sub! not working > On Wed 04 Jun 2003 at 12:39:20 +0900, Hal E. Fulton wrote: > > > Look at it this way: Suppose the [] and []= > > methods were renamed to #get and #set. > > > > You would not expect ENV.get(x).sub! to > > change ENV just because ENV.set(x) does so. > > Makes sense? > > That's a very lucid explanation and I find I can now appreciate the > issue a lot more easily. > > It's the fact that the get method is invisible within 'ENV[foo]=' that > makes the issue so tricky. > > Thanks for taking the time to explain this so well (and repeatedly). No problem. Explaining is the best way to understand something yourself. ;) This probably does belong in the FAQ, as it is non-obvious. There are similar confusing issues with certain other objects, though I can't think what they are right now. Hal