Raku / examples

Many examples of Raku code
https://examples.raku.org/
Artistic License 2.0
297 stars 82 forks source link

A second implementation that does half the work; more tests #14

Closed ajs closed 9 years ago

ajs commented 10 years ago

An improvement to the palindrome example #6 plus a few additional input samples.

ShimmerFairy commented 10 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.

paultcochrane commented 9 years ago

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!