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

>
> ok i guess i need a rule 5, you may not mention class X in your code
>
>>
>> module M
>>    class ::X
>>      include N
>>    end
>> end
>
> also you did not solve rule 3
>
> -- 
> Posted via http://www.ruby-forum.com/.
>

Here's some more whacky code:

% cat whackextend.rb
module M
    $old_extend = Object.instance_method(:extend)
    class ::Object
      def extend(other)
       if other.name == "M"
          eval %Q{
           class #{self}
             include N
             def initialize
               foo
             end
           end
           }
       else
         $old_extend.bind(self).call(other)
       end
     end
   end
end

I'm pretty sure it follows all your rules.