user-pic

dakkar

  • Commented on Switch lots of things on at once
    I like this pattern so much, that some time ago I release a library to make it easier: Code::Style::Kit It's essentially the same thing you're describing, but as re-usable components. As an intermediate step, import::into hides the different ways of...
  • Commented on I think subroutine signatures don't need arguments count checking
    If you don't want the runtime to check for argument count, you can say: sub foo($x,$y,@) { ... } and the "too many arguments" check won't be compiled (I just checked with B::Concise)....
  • Commented on A small puzzle for you
    #!/usr/bin/env perl use strict; use warnings; use List::AllUtils 'uniq'; use Data::Printer; sub align { my @all_values = sort(uniq(map {@$_} @_)); for my $param (@_) { my %hash;@hash{@$param}=@$param; @$param = @hash{@all_values}; } return; } my @a = ( 'b', 'c',...
  • Commented on I hate Dist::Zilla and missing Makefile.PL
    Yep. That's why I use the Git::CommitBuild plugin, to give you both https://github.com/dakkar/Net-Stomp-MooseHelpers/tree/v2.1-dzilla (what I write) and https://github.com/dakkar/Net-Stomp-MooseHelpers/tree/v2.1 (what you can use without dzil). This way, anyone can send me patches for whichever version they're most confortable with, and I...
  • Commented on Keeping a Reasonable Number of Incremental Backups
    That looks very much like http://www.rsnapshot.org/ I've been using it for years and it's very very simple....
  • Commented on I try postderef and key-value slice in Perl 5.19.5
    That's not the way ->%{} is supposed to work. $a->%{foo} returns foo => $a->{foo}, and you can't assign to such a thing. You probably meant $new_params->@{'FOO', 'BAR'} = $params->@{'foo', 'bar'};, which does the assignment you're looking for....
  • Commented on A feed reader
    It would not be particularly complicated to get Feeder to send email instead of writing to a maildir: you just write a role to do that. It would be like Feed::Role::MailDir, but instead of using Maildir::Lite, it would directly send...
Subscribe to feed Recent Actions from dakkar

  • Yuki Kimoto commented on I think subroutine signatures don't need arguments count checking

    I assume javascript function.

    function foo(x, y) {

    }

    foo(1) // ok
    foo(1, 2) // ok
    foo(1, 2, 3) // ok

    Perl should implement javascript subroutine signatures at first step.

  • Yuki Kimoto commented on I think subroutine signatures don't need arguments count checking

    and PHP

    function foo($x, $y) {

    }

    foo(1) // ok
    foo(1, 2) // ok
    foo(1, 2, 3) // ok

    I like JavaScript and PHP way. This is natural.

  • weissel commented on I think subroutine signatures don't need arguments count checking

    Hmmm.

    Yuki, you seem to have a strong opinion here.
    Not that there is anything wrong with having strong opinions --- but it would be much better if you could at least point to some facts that support your opinion.
    Like, say, benchmarks. Like, say, code (show the source code!) that does run appreciably faster without argument checking.

    Performance at all costs of programmer usability, maintenance and bug finding ease would mean that you write highly optimized, hand-polished assembler running on the bare metal of the machine, with no OS to slow things down…

  • Ben Bullock commented on Switch lots of things on at once

    Thanks for commenting, I will be taking a close look at your module when I next need to update/add something. Today I added signatures to this Z thing, I've decided to start using them, since it seems there is some progress now at the Perl Porters on future Perl. The annoying thing was getting the imports and unimports right. I think Toby Inkster's Z module uses some kind of super-duper import module. Here it is:

    https://metacpan.org/pod/Import::Into

  • Grinnz commented on Switch lots of things on at once

    Also check out Import::Base, which is just a wrapper around Import::Into to make this specific sort of module.

Subscribe to feed Responses to Comments from dakkar

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.