On May 4, 2006, at 10:14 PM, polypus wrote:

> ok for those who like pointless exercises here is a harder version.
>
> rules:
>
> 1) you may replace the elipses with any amount of code but may not  
> alter
> any other part of the code listing
> 2) when the program is run it must return, i.e. X.new must evaluate to
> an instance of class X
> 3) foo must be called as an instance method of an instance of X and
> print something like #<X:0xb7e188a4>
> 4) you may not use class_eval, module_eval, or use the extend_object
> callback
>
> module N
>   def foo
>     puts self
>   end
> end
>
> module M
>   ...
> end
>
> class X
>   extend M
> end
>
> X.new
>
> yes there is a solution, good luck
>
>
> -- 
> Posted via http://www.ruby-forum.com/.
>

module M
   class ::X
     include N
   end
end