Joe Schaefer wrote:
"Philippe M. Chiasson" <[EMAIL PROTECTED]> writes:


[...]


 2) symbols are occasionally aliased into other namespaces (eg Exporter),
and those aliases won't get rebound once the new symbol definitions
    are loaded.

Well, partially true. It just means the existing aliases will be pointing to the _old_ values for that module. Kinda similar to an external module taking a ref to a sub in the package.


I haven't looked closely at your patch, but situation I had in
mind here is this:

  module X exports X::foo, which is imported into module Y.
  If the reloader for X undef's &X::foo, and reloads X,
  Y::foo is no longer defined.  If the reloader doesn't
  undef &X:foo, then Y uses the old foo() sub instead
  of the new one.
>
It seems to me that you can wind up breaking Y::foo either way you implement the reloader for X.

Actually, my second attempt will never end up with something like an undefined alias, or dangling ref, or sth. An aliased/imported reference like you described would keep the old value, until Y was reloaded.

But I see that as a feature, meaning that references to the old code
persist if they need to and keep their internal logic. Anything else
gets the new code.


-- -------------------------------------------------------------------------------- Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5 http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5

Attachment: signature.asc
Description: OpenPGP digital signature



Reply via email to