user-pic

Diab Jerius

  • Commented on Method Privacy in Perl
    I've also been burned by overriding a "private" method in a parent class. Class::Method::Modifiers provides the fresh modifier, which will throw an exception if you override a method already defined by a parent class....
  • Commented on Let's delete 10,000 files from CPAN
    Thanks for the reminder. Happy Northern Hemispheric Spring!...
  • Commented on Relief from Regexes
    I'm a big fan of rxrx, which is part of Damian Conway's Regexp::Debugger package. A downside is the lack of command line history, but that can be dealt with using rlwrap. For those who haven't seen it in action, it...
  • Commented on Keep yer notes
    Here's another for your notes binder: perlsecret...
  • Commented on Extracting values from a list of (key, value) pairs
    @Graham Knop: I've fixed the code; thanks. @Aristotle: It actually seems to slow it down by a bit. Sequential runs with with your suggestion implemented, followed by the original code give: with: 1002/s 1016/s original: 1049/s 1075/s The difference between...
  • Commented on Extracting values from a list of (key, value) pairs
    @QM: You've raised some good points. Yes, @k would have been a better choice than @v. My mistake. I'd fix the code, but then your comment would have no context. Why a short variable name? The focus here is on...
  • Commented on Extracting values from a list of (key, value) pairs
    And just for completeness, I added direct assignment into the target array (idxa). As might be expected, it's significantly slower than pushing onto the end of the array (idxp)....
  • Commented on Extracting values from a list of (key, value) pairs
    Thanks for adding that to List::Util. Peeking at your code led me to realize I'd forgotten to add straightforward array indexing. It's surprisingly fast. XS still wins, though....
  • Commented on Extracting values from a list of (key, value) pairs
    A colleague pointed out I'd left out toggling using exclusive or; I've added that....
  • Posted Extracting values from a list of (key, value) pairs to Diab Jerius

    If you need ordered key, value pairs, you can either use something like Tie::IxHash or a simple array of key, value pairs.

    There are a number of…

  • Posted Automating POD previewing to Diab Jerius

    I find it difficult to review documentation written in a markup language. I need to see that final pretty rendition of it as a manual page, PDF file or HTML web page before I can get a feeling if the thing makes sense. I also like to see that final rendition while I'm writing the document,…

  • Commented on Tool tip: looking at a module's source
    My favorite: cpandoc -m...
  • Commented on p5-mop, a gentle introduction
    I am concerned by the loss of 'undef' as a value for attributes. One of the benefits of having it is that it actually has intrinsic meaning. For example (pardon the pseudo-code) let's say that class Foo's constructor accepts an...
  • Posted Perl and Perl Module Administration in the Modern Era to Diab Jerius

    I recently gave a talk on perlbrew, cpanminus,…

  • Posted Building pluggable backends with Moo to Diab Jerius

    I've been working through the design and implementation (using which implements some backend functionality via plugins. The nature of the module isn't that important; suffice it to say that there's a rendering backen…

  • Commented on Params::Validate::Dependencies
    Nice. I submitted a patch to P::V a few years back to add mutually exclusive parameters (see bug 5701) but it wasn't accepted; would you be able to incorporate some of those ideas in your work?...
Subscribe to feed Recent Actions from Diab Jerius

  • Toby Inkster commented on Method Privacy in Perl

    That only partly solves the problem. It prevents subclasses from overriding the method when called from inside my class.

    It doesn't solve the wider problem of making it clear which methods are suitable for subclasses to call/override, and which methods are too unstable for other people to rely on.

    Also, I don't find it especially aesthetically pleasing. I like my method calls to have a pointy arrow.

  • Dmitri commented on Method Privacy in Perl

    Sure, it does not solve the non-private method classification and designation problem. It does, however, solve the private method problem. What one needs to observe is that if a method is so private that it cannot be called from any other class, it does not have to be a method. In other words, there is no need for private methods at all.

    Maybe the desire for private methods is due to once-upon-a-time carbon-copy of Java concepts into Perl. The problem that Java has is that there are no functions, everything is a method (I think -- don't claim to be a Java expert). We, on…

  • Mike Friedman commented on Method Privacy in Perl

    I've been wondering recently if it would be possible to use the MRO API to be able to invoke lexical subs as methods. Then you wouldn't have to use the $ sigil in your method calls.

  • Liz commented on Method Privacy in Perl

    Perhaps a source of enlightenment:

    http://perlcabal.org/syn/S12.html#Submethods

  • Sid Burn commented on Method Privacy in Perl

    Don't use inheritance. All problems solved.

Subscribe to feed Responses to Comments from Diab Jerius

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is run by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.