Closed ajs closed 9 years ago
Looks good, though since it's basically a separate solution, it would be more ingenuous to move your changes into a separate file, P06-ajs.pl
or such.
Additionally, since you're doing a lot of testing, perhaps rework the file to use the Test module (particularly the is
function, e.g. is $f($list), $result, "{$f}($list.perl) returns $result."
). It's not necessary but would be more idiomatic with respect to testing things in Perl 6.
Added a modified version of the initial PR as of 6344083. Many of the @japhb's suggestions have been incorporated (it seems that parens are now needed around params to block for loops now...). I've left use of the Test module out as it's interesting to run this program as an example and not necessarily as a test; this is what we have a test suite for :-) Thanks for your contribution!
An improvement to the palindrome example #6 plus a few additional input samples.