From: Glenn Parker Date: 2005-01-18T22:27:51+09:00 Subject: Re: Fwd: [suby-ruby] Your all time desired fundemental Ruby mod Yukihiro Matsumoto wrote: > > Initializing module instance variables are one of the things I want to > fix. But I'm not sure what is the best way to fix. Maybe AOP-like > hooks is the way to go. I'm waiting the conviction to come. It's not pretty, probably because the idea is based on Perl experience: module MM def x @x_value ||= 100 redefine_x x end def x=(xx) @x_value = xx end private def redefine_x class << self def x @x_value += 1 end end end end -- Glenn Parker | glenn.parker-AT-comcast.net |