From: Joel VanderWerf Date: 2001-09-26T07:26:43+09:00 Subject: [ruby-talk:21690] Re: manipulating "immutable" objects such as Fixnum from within callbacks & al... Guillaume Cottenceau wrote: > Here's the problem: it happens often that you need to pass "references" to > objects so that callbacks/functions/etc may modify these objects to their > convenience, and you will need the modified value afterwards. What about using a closure that references local vars in the caller's scope? (This is discussed a bit on pp.47-8 of the Pickaxe book.) def doit yield 1 end t = 3 doit { |i| t += i } puts t ==> 4 > Guillaume Cottenceau - http://people.mandrakesoft.com/~gc/