From: Robert Klemme Date: 2005-10-01T22:16:46+09:00 Subject: Re: Lazy evaluaton (was Re: In your opinion....) Daniel Lewis wrote: > oooh my thread has split :) Better your thread than your head. :-) > I'm going to be noting all this down, Lazy Evaluation is a subject in > Functional Programming and AI. .... although it's by far not restricted to that. Btw, recently I discovered (better: started using) an interesting idiom that exploits the fact that both Proc and Hash implement #[]. FUN = config_memoized ? Hash.new do |h,k| # complex calculate val h[k] = val end : lambda do |k| # complex calculate val end # later x = FUN[y] Nothing really fancy I guess but it's nice how seemingly these integrate. (Now, is this another thread split?) Kind regards robert