t/01-sanity/07-isa.t
. This morning I got the test running again by switching to the parrot subdirectory, doing svn update
, and running make
. Then I switched back to the Rakudo directory and rebuilt it. Now make test
runs fine. Yay!So here's my first stab at the squares program in Perl 6. It's a lot more compact than the Perl 5 version, but I feel dirty using
map
solely for a side-effect. Surely there must be a better way to do it?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6; | |
my %count; | |
map { %count{($_ * $_) % 256}++ }, 1..128; | |
say "{%count.keys.sort({ $^a <=> $^b }).join(" ")}" |
Update: Thanks to moritz_ and Tene on #perl6, I now have a much more Perl 6ish version:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6; | |
my @seed = 1..128; | |
@seed.map({ ($_ * $_) % 256 }).uniq.sort({ $^a <=> $^b }).join(" ").say; |
Great! I wonder if you could also try getting Padre and Padre::Plugin::Perl6 working on OS X.
ReplyDeleteUnderstanding that I have extraordinarily little in the way of free time if it turns out to be tricky, sure, I wouldn't mind taking a crack at it. Where do I start?
ReplyDelete# This should install Padre along
ReplyDelete# with Perl 6 support
$ cpan Padre::Plugin::Perl6
Most of the development team are found at #padre @ irc.perl.org (you can use mibbit.com to access it if you're behind something that prevents accessing IRC). Padre's website is http://padre.perlide.org .
I hope we can see Padre running smoothly over Mac OS X soon :)