in reply to List module providing any,all and none

You are reinventing Quantum::Superpositions, only not as completely. Those features will also be built into Perl 6.
  • Comment on Re: List module providing any,all and none

Replies are listed 'Best First'.
Re: Re: List module providing any,all and none
by eric256 (Parson) on Apr 15, 2004 at 17:49 UTC

    Thanks for the reply but I am not reineventing Quantum::Superpositions. This is a lightweight module meant for when you simply want the comparison functions of Quantum::Superpostions without going overboard.


    ___________
    Eric Hodges
      But you are "reineventing" Quantum::Superpositions. When I simply only want the comparison functions of Q::S, I simply use only them. No need to go overboard just because Q::S does a lot more.

        There is a significant benefit to the lighter weight module. Here is the benchmark.

        use strict; use warnings; use Benchmark qw(cmpthese) ; use Func; use Quantum::Superpositions; my @a = (1..50); my @b = (35 .. 100); cmpthese(-20, { 'Func- Any > Any' => sub { my $test = Func::any(@a) > Func::any(@b); }, 'Q::S- Any > Any' => sub { my $test = Quantum::Superpositions::any(@a) > Quantum::Sup +erpositions::any(@b); }, }); __DATA__ Rate Q::S Func Q::S 10.7/s -- -84% Func 67.5/s 534% --

        You can say thats not conclusive because i didn't test all the features etc. You would be 100% correct. That doesn't change the fact that for smaller everyday things, its lighter and faster. Now if i'm not suppose to try to make things faster/easer then why do we have so many ::simple modules? I realy just dislike the don't reinvent the wheel attitude because it implies that because its already been done once no one else can do it different and there is no need for an alternative. Perhaps there is no use for this module and that is fine. I am however not reinventing Quantum::Superposistions, this module will not do everything thing that one does, and it does not do everything this one does.


        ___________
        Eric Hodges