Validate International Securities Identification Number: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: added/changed whitespace, used templates for the output sections.)
Line 1,612: Line 1,612:
The luhn test is repeated here for simplicity (from Luhn_test_of_credit_card_numbers#langur).
The luhn test is repeated here for simplicity (from Luhn_test_of_credit_card_numbers#langur).


{{works with|langur|0.6.11}}
<lang langur>val .luhntest = f(.s) {
<lang langur>val .luhntest = f(.s) {
val .t = [0, 2, 4, 6, 8, 1, 3, 5, 7, 9]
val .t = [0, 2, 4, 6, 8, 1, 3, 5, 7, 9]
Line 1,629: Line 1,630:
return false
return false
}
}
.luhntest(join ZLS, map f toNumber(.c, 36), split ZLS, .s)
.luhntest(join map f toNumber(.c, 36), split .s)


# used unbounded lists on join(), map(), and split()...
# used unbounded lists on join(), map(), and split()...
# ... and implied parameters and a single expression on the anonymous function
# ... and implied parameters and a single expression on the anonymous function
# same as .luhntest(join(ZLS, map(f(.c) { toNumber(.c, 36) }, split(ZLS, .s))))
# same as .luhntest(join(map(f(.c) { toNumber(.c, 36) }, split(.s))))
}
}