From: jeremy@... (Jeremy Henty) Date: 2001-10-09T07:02:48+09:00 Subject: [ruby-talk:22266] Re: Why does Class undefine module_function? In article <1002500595.895756.17271.nullmailer@ev.netlab.jp>, matz@ruby-lang.org (Yukihiro Matsumoto) writes: >In message "[ruby-talk:22211] Re: Why does Class undefine module_function?" > on 01/10/08, Jeremy Henty writes: > >|So the reason is that instance methods of a class may depend on >|the receiver being of the right class (particularly if they are >|builtins or extensions that access the underlying C structures) >|whereas instance methods of a module are agnostic about the class >|of the receiver (because the module could be included into any >|class) and so can be invoked on any object without fear? > >Yes. Instance methods of modules agnostic about the TYPE of the >receiver, since modules do not do allocation, their methods cannot >have any assumption for object types. This makes things clearer than ever. Thanks Matz, your help is *much* appreciated. Cheers, Jeremy Henty -- http://www.rubygarden.com/ruby?JeremyHenty Ruby: programmer's best friend -- John Robson