Skip Menu |

This queue is for tickets about the Acme-Dot CPAN distribution.

Report information
The Basics
Id: 7946
Status: resolved
Priority: 0/
Queue: Acme-Dot

People
Owner: ovid [...] cpan.org
Requestors: persnickety_apologetic [...] davidnicol.com
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: (no value)
Fixed in: (no value)



Subject: caller() can take an arg, you know
it seems that Acme::Dot does not need to clobber the caller's import function in order to determine $call_pack2 = (caller(1))[0] furthermore, clobbering call_pack2's AUTOLOAD seems clumsy. Acme::Dot works by creating an AUTOLOAD in the outer using package that catches unknown method calls and returns objects that make sense to the routine that dot has been overloaded to. we could do this without replacing AUTOLOAD by polluting the outer package with many little functions that the dot-handler can take for each of the dot-invocable methods. The list of methods could be made arguments to Use Dot or the list of methods could be determined by analyzing the symbol table in a CHECK block or in a wrapper to the caller's import. furthermore we can't Use Dot in multiple modules and have them all work since the CHECK block would only run with regard to one of them, so a wrapper to the caller's import might be the way to go. Something like sub Dot::import{ ... eval "package $call_pack;\n".<<'EOF'; CHECK { my $pollute = sub { make a bunch of method in caller(1)'s namespace }; if (defined (&import)){ my $orig_import = \&import; *import = sub { $pollute(); goto &$orig_import ; } }else{ *import = sub { $pollute(); } } } EOF The collision modes between methods, that have to get exported because of dot, and functions in the using package, does not appear resolvable. Using object dispatch within the overload handler means that multiple packages that dot-export methods with the same names will not be a problem. thanks
For a long time, I had my cpan email going to /dev/null due to spam. The problem's been resolved so I should get these reports more frequently now. In any event, thanks for the info. I'll take a look at this soon. Cheers, Ovid [guest - Sun Oct 10 15:19:30 2004]: Show quoted text
> > it seems that Acme::Dot does not need to clobber the caller's import > function in order to determine > > $call_pack2 = (caller(1))[0] > > > furthermore, clobbering call_pack2's AUTOLOAD seems clumsy. Acme::Dot > works by creating an AUTOLOAD in the outer using package that catches > unknown method calls and returns objects that make sense to the > routine that dot has been overloaded to. > > we could do this without replacing AUTOLOAD by polluting the outer > package with many little functions that the dot-handler can take for > each > of the dot-invocable methods. The list of methods could be made > arguments > to Use Dot or the list of methods could be determined by analyzing > the > symbol table in a CHECK block or in a wrapper to the caller's import. > > furthermore we can't Use Dot in multiple modules and have them all > work > since the CHECK block would only run with regard to one of them, so > a wrapper to the caller's import might be the way to go. Something > like > > sub Dot::import{ > ... > eval "package $call_pack;\n".<<'EOF'; > CHECK { > my $pollute = sub { > make a bunch of method in caller(1)'s namespace > }; > if (defined (&import)){ > my $orig_import = \&import; > *import = sub { > $pollute(); > goto &$orig_import ; > } > }else{ > *import = sub { > $pollute(); > } > } > } > EOF > > > The collision modes between methods, that have to get exported because > of dot, and functions in the using package, does not appear > resolvable. > > Using object dispatch within the overload handler means that multiple > packages that dot-export methods with the same names will not be a > problem. > > thanks
I believe these issues have been taken care of in Acme::Dot 1.10. It should be on the CPAN soon. Unless I hear of problems, I'll close this ticket in a day or two.
These issues appear to be resolved and the current version of Acme::Dot will likely be the last version unless new features/bugs are requested/found. Cheers, Ovid