From: Christoph Date: 2002-04-16T03:02:30+09:00 Subject: Re: RFC - class_added callback This is a multi-part message in MIME format. ------=_NextPart_000_003F_01C1E4AA.868EC000 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable > From: Michal Rokos=20 .... > You can see from the patch that "class_added" callback is = called > in the same situation as "inherited". >=20 > But with different "receiver". That's the bonus. >=20 > I will be a little rude and answer by question: "What for is > "method added" and what for "inherited" callback?" The answer = is > the same as for "class_added" callback. >=20 > Michal >=20 >=20 > PS: The right answer could be: To keep you (Class) informed about (new > classes in your modules, classes). =20 I think this a nice idea however given your implementation the correct = formulation should be "To keep your Module informed about new ``NON-anonymous' modules/ = classes. =20 From this point of view it makes plenty of sense to rewrite your patch = more general: =20 =20 class Module private def const_added( const_name); end end =20 =20 which would be called when ever a new constant is added (and/or changed? not sure) - such a hook method would be quite useful IMO. =20 /Christoph ------=_NextPart_000_003F_01C1E4AA.868EC000 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

> From: Michal Rokos

...

>         = You=20 can see from the patch that "class_added" callback is=20 called

>         = in=20 the same situation as "inherited".

>

>         = But=20 with different "receiver". That's the = bonus.

>

>         = I=20 will be a little rude and answer by question: "What for=20 is

>        =20 "method added" and what for "inherited" callback?" The answer=20 is

>         = the=20 same as for "class_added" callback.

>

>            &nbs= p;      =20 Michal

>

>

> PS: The right answer could be: To keep you (Class) = informed about=20 (new

> classes in your modules, = classes).

 

I think this a nice idea however given your implementation the = correct=20 formulation should

be "To keep your Module informed about new ``NON-anonymous' = modules/=20 classes.  =

From this point of = view it makes=20 plenty of sense to rewrite your patch more general:

 

 

class Module

   =20 private

    def = const_added( const_name); end

end

 

    =20

which would be called when ever a new constant is added (and/or = changed?

not sure) - such a hook method would be quite useful=20 IMO.

 

/Christoph

------=_NextPart_000_003F_01C1E4AA.868EC000--