Palindrome detection
Built-in
say "noon".is_palindrome # true
Non-recursive
func palindrome(s) {
s == s.reverse
}
Recursive
func palindrome(s) {
if (s.len <= 1) {
true
}
elsif (s.first != s.last) {
false
}
else {
__FUNC__(s.ft(1, -2))
}
}