ISBN13 check digit: Difference between revisions

(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
Line 188:
 
=={{header|langur}}==
{{works with|langur|0.78.210}}
In this example, we map to multiple functions (actually 1 no-op).
<lang langur>val .isbn13checkdigit = f(var .s) {
.s = replace(.s, RE/[\- ]/)
matching(re/^[0-9]{13}$/, .s) and
fold(f{+}, map( [_, f .d x 3], map(f .c-'0', s2cps2n .s))) remdiv 10 == 0
}
 
1,006

edits