From: Robert Klemme Date: 2009-01-27T06:07:53+09:00 Subject: Re: Question about BlankSlate.reveal On 26.01.2009 17:18, Gregory Brown wrote: > On Mon, Jan 26, 2009 at 8:55 AM, Robert Klemme > wrote: > >> I do not really see caching that extends the instance on which #reveal >> was invoked. There is actually one closure per instance (more >> correctly: one closure per call of reveal) and so no global cache. >> >> Where exactly is your problem? > > I think you missed that the local variable was at the class level. Right, you stated so in the text and then I got confused by "unbound_method.bind(self)". :-) But in that case my remark about binding at class level remains true: there is no point in binding to a particular instance at class level and caching that. And your code seems to indicate that you agree with me there. > But I think I have a suitable fix: > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/325826 > > What do you think? Looks good to me. I didn't test it though. ;-) Kind regards robert -- remember.guy do |as, often| as.you_can - without end