Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re^2: Private method variations

by adrianh (Chancellor)
on Mar 01, 2004 at 08:58 UTC ( #332828=note: print w/replies, xml ) Need Help??

in reply to Re: Private method variations
in thread Private method variations

How is SUPER implemented? I think it would make more sense to leverage that code and make it part of Perl itself.

I doubt there would be much code to leverage. Beyond the lexical similarity there's not a lot of common ground. SUPER is doing a runtime method lookup, while MY is doing compile-time namespace fiddling.

An alternative I prefer better is to make it an attribute

You could use an attribute to wrap a method to check it was only called on objects of a specific type. However this would still leave the method in the same name space, which leads to the original problem of subclasses breaking due to implementation changes in the base class.

You could also use the attribute, I guess, to mark methods for later transfer to another namespace in an INIT block - but that would still leave the method calls to be dealt with. You'd have to use a source filter for that - or use the full package name of the private namespace which CanBeTedious.

Of course in Perl 6 it would both trivial (since we have a decent macro system) and unnecessary (since Larry and friends are making what looks to be a very nice OO environment).

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://332828]
[Corion]: Mhhmmm - https://sod.pixlab .io/ looks really interesting for embedding with Perl (XS), but they don't have any kind of free model available and the cheapest pretrained model costs EUR 40 :-(
[Corion]: Maybe I should mail them to find out if they can provide me a "hotdog / no hotdog" model for developping the XS bindings. It would be nice to have a self-contained XS library for applying models to data. Or maybe I should look at TensorFlow, which can...
[Corion]: ... at least be trained by me, instead of relying on a vendor
[Discipulus]: complex and interesting

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2018-06-18 10:46 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (109 votes). Check out past polls.