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

use Perl Log In

Log In

[ Create a new account ]

pmichaud (6013)

  (email not shown publicly)

Patrick Michaud is the pumpking for the Rakudo Perl 6 compiler. He holds a Ph.D. in Computer Science and was formerly a Professor of Computer Science at Texas A&M University-Corpus Christi. He is currently a software developer and consultant focused on open source development and applications, including Perl, PmWiki, and Linux.

Journal of pmichaud (6013)

Thursday November 13, 2008
03:18 PM

Rakudo any/all/none junctions now collapse

[ #37868 ]

For those who are wondering what happened to my journal posts over the past couple of months -- I've been focusing on some underlying Rakudo/Parrot design issues and supporting others more than writing code or prose. Also, I think I needed a bit of a break.

I've decided that it'll be easier (and thus more likely) for me to increase visibility on Rakudo progress if I blog about new features and decisions as they happen rather than try to batch them up for a post every few days. I do still plan to come up with "weekly summaries" as well, but I figure the immediate posts will be more satisfying for me and more helpful for others.

So, here's the first such post -- earlier this week I refactored Rakudo's Junction implementation to be cleaner and more correct, and bacek++ provided a patch to collapse duplicate values of one, any, and none Junctions. We had to wait for confirmation from perl6-language for this, which we just got today. So, we now have:

        > say any(1,2,2,1,3,2).perl;
        any(1, 2, 3);
        > say (any(1,2,3) % 2).perl;
        any(1, 0);

Although any/all/none junctions collapse, one() junctions do not:

        > say (one(1,2,2,1,3,2) % 2).perl
        one(1, 0, 0, 1, 1, 0)

This is because duplicate values change the boolean meaning of a one() junction, so we can't simply collapse them. As Larry says, "... one() junctions produce bags rather than sets."

As a result we've been able to unfudge more spectest for rakudo -- we're currently (r32625) passing 4598 spectests.

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.