From: Pit Capitain Date: 2005-11-05T11:46:51+09:00 Subject: Re: [ANN] lazy.rb MenTaLguY schrieb: > ... > Same problem in both cases, basically. Here's another implementation that doesn't have these problems: module Lazy #:nodoc: all class Thunk instance_methods.each { |m| undef_method m unless m =~ /^__/ } def initialize( &computation ) @computation = computation end def method_missing( *args, &block ) ( @result ||= @computation.call( self ) ).send( *args, &block ) end end end Regards, Pit