user-pic

RonW

  • Commented on The Hidden Power of Prototypes
    I agree that prototypes are a very useful tool. Try::ALRM is genuinely useful and interesting. I see the main limitation on prototypes being that & only coerces on the first parameter. I don't see a downside to & coercion on...
Subscribe to feed Recent Actions from RonW

  • Brett Estrade commented on The Hidden Power of Prototypes

    > I don't see much advantage to Dispatch::Fu. While it adds a little syntactic sugar, it's really just an indirect way to do...

    That's the point, but it's more than sugar! The computational complexity of determining the dispatch "key" is entirely contained in the "dispatch" block and is under the control of the developer. Once the "key" is determined, the proper method is called as O(1)!

    Thanks for all to good info above, didn't know bout the "_" allowing one to default to "$_" - I was actually wondering about that recently!

  • Brett Estrade commented on The Hidden Power of Prototypes

    I am not good at coming up with contrived examples as evidenced in this Perl Advent article,

    https://perladvent.org/2023/2023-12-13.html

    But a set of cascading "if" blocks is not the most exciting example. However, any code could go in there to compute the key to then "call".

Subscribe to feed Responses to Comments from RonW

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.