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