Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Question: what's wrong with the following picture?

    Source filters, when done properly, can make programming much, much easier. I didn't realize how much I missed signatures until I had them again.

    Answer: these sentences have nothing to do with each other []. Your argument is fallacious.

    I did not condemn the idea of subroutine signatures at any point. I am deprecating source filters. I asked whether Sub::Signatures achieved the thing I want using the thing I don't, because I like Inline::Files [] and Switch []

    • by Ovid (2709) on 2004.12.05 23:39 (#36556) Homepage Journal

      The sentences appear to have nothing to do with each other because there's a chain of logic between the two that's not explicitly spelled out. 1. Subroutine signatures eliminate common problems in Perl. 2. Source filters can be used to implement subroutine signatures. 3. Therefore, source filters can be used to make programming easier (yes, there are still a few gaps, but without being too pedantic, you can see where I'm coming from.) As for whether or not this addresses your particular concern, that's something you'd have to decide for yourself.

      As a more concrete example, you can read through one of my personal experiences with source filters []. The gains far outweighed the losses. Seeing source filters actually work to my advantage is what changed my mind. Production on our code would have been slower without it.

      • Again: is there no other way by which subroutine signatures could be implemented than source filters?
        • The only way I can think of is to rewrite the guts of Perl. Of course, that project is already started and it's called Perl 6 :) I think you might be able to do something with attributes, but that wouldn't give you the dispatching that is the primary benefit of this module.

          • Depends on the syntax — I cannot think of a way to implement yours without a filter either, but my thinking is more along the lines of not inventing new syntax at all, rather simply passing the function as a closure to some other function. Perl is introspective enough to do the backend stuff without source filtering.