in reply to Re^6: RFC: Junction.pm
in thread RFC: Junction.pm

P6 also has 'one'.
return $true if (($self->{type} eq 'none') && scalar @{$true} == +0) or (($self->{type} eq 'all') && scalar @{$false} == +0) or (($self->{type} eq 'any') && scalar @{$true} != +0) or (($self->{type} eq 'one') && scalar @{$true} == +1);

Also, @EXPORT should become @EXPORT_OK. I may want to import all(), but I already have an any() I don't want you to clobber.

Lastly - you gonna release this or attempt to patch Perl6::Junction? The number of tests for this is going to be quite ... impressive. :-)


  • In general, if you think something isn't in Perl, try it out, because it usually is. :-)
  • "What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?"

Replies are listed 'Best First'.
Re^8: RFC: Junction.pm
by eric256 (Parson) on May 04, 2005 at 15:25 UTC

    Yea I can add a one function. There was some reason I didn't but I can't remember it now. ;) Might have been an older version of the code and yea I did intend to fix the export stuff and release it. Now I don't realy want to release it because his code does the same thing in the end, but they are drasticaly different code wise (and of course I'm quite fond of my own way ;) ). So wadda think? Release a second one that does almost the same thing? Or just keep it as my pet project on PerlMonks? Is there any harm to me releaseing a seperate but similar module just so that I can get experience with module releases?


    ___________
    Eric Hodges

      There's no harm in releasing your own module, but I'd certainly welcome a patch to Perl6::Junction.

      I was planning on using a startup-eval method to add the arithmetic operators, similar to yours but creating a 'real' subroutine rather than a sub-ref in a hash. What's holding me up though, is getting the time to write the tests, which as dragonchild suggested, is no small task.

      (If you do wish to contribute, including tests would be good :)

        You should be able to grab tests from Pugs ...

        • In general, if you think something isn't in Perl, try it out, because it usually is. :-)
        • "What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?"

      TheDamian has just sent me an implementation of Perl6::Junctions that he had already coded and hadn't done anything with.

      It contains a lot more features from the Perl6 spec, and has some fun code that I'm sure you'll like.

      Could I maybe suggest you hold off releasing your own for now, I'll try and get Damian's code into the Perl6::Junction distribution as soon as I can, and then see what you think?

        I've held onto the code for a year whats a few more days? I'm only interested in releaseing it in order to learn how to release such things. I've also just realized I can eliminate some of the evals and produce one big eval. This is pretty much just my toy module to play and learn with. I think all of my tests will work with your code as well, although you already have a pretty large number of tests.;)


        ___________
        Eric Hodges