From: Urabe Shyouhei Date: 2010-10-07T10:03:01+09:00 Subject: Re: Why does Module#include exclude the module's metaclass? --------------enig424AB80AB38A805DF648EE5C Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable (2010/10/07 8:33), John Mair wrote: > Ok, so my question: is there a theoretical/conceptual reason behind thi= s > limitation on modules? or was it just an implementation difficulty? The former. 1) So-called "class methods" are singleton methods of those Class class i= nstances. 2) A module's class methods are hence, singleton methods of a Module clas= s instance. To say it in another word, they are instance methods of the singleton class of such module. 3) So if you want a module inclusion to cause somewhat injecting a module= 's singleton methods into a class's, there should be this relationship: +---------+ +---------+ | Meta A +---> Meta M | +----^----+ +----^----+ | | +--+--+ +--+--+ | A +-------> M | +-----+ +-----+ 4) But this is impossible, because Meta M is a class. A class cannot be included into another class. --------------enig424AB80AB38A805DF648EE5C Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJMrRwsAAoJEIG/BHYvGcFLWcIQAKmxxXTFnPT//XeRqYFQsi0B oFYM8fUNqffQANLqYOby2f1L6SuOqwZ1HS59J2tG4tpXIeEMTLZfg64jxn3qIfZn nCo6lbadUBFAxaEyo6+tGwE/zqNHz/+vo1US5CD2Hh/3iwbiov/Zv6TTj1KSPOg7 HQXqAWe7MZwuBv3i8/xg+asBaG/e7lmvkQkK3ZwHWV8wfhrTqQOSdU0yZZe6GkoP gRGTSljaTxyP6gBzKvo8jp3VZ0MndiT5Gp/ZMKNgGaU6wpl7I9/ILIBypnbx0WRy 9qoZJ+9LbsUkcncn/g+3DtZ12UUl1jvKQm6M4SI5zAIT0JGhQ5YlicqL85TcM+/N 1CB9qxRIrsVkb0lf3MOyTSjWs8d+HIPZB9qTUNSmUbXEhXWCFmeBvZ65nXZamD6s suLRL6/Zs6ZaPW8WijKGDr2uQGktUZLhaiEs63QvqoqNp7fkxEa641wZBkfzJmip nud9YhxAAtKCgFtoIU+tsi0NihbmKcVDXbWu7cjfUXad4DAJnGQjrO+aECh2VEim VA41uI5Q10juESZsVXwFww2xGWz9UixCNo4ekMVovJvteq9bqptCSWGfieS/HxVT 7kGqlUkTjhA3vYanGEuuoYCqQu/bmJAL4G6GyPYnq0Hlx+3dBtayEQX5/t/EvevR wBmV/niXtD6q2VVV5MWT =Adfr -----END PGP SIGNATURE----- --------------enig424AB80AB38A805DF648EE5C--