local function pali(str)
return ( {
[true] =
-- go deeper
function() return pali( str:sub(2, -2) ) end,
[#str < 2] =
-- short word is always a palindrome
function() return true end,
[str:sub(1, 1) ~= str:sub(-1, -1)] =
-- the 1st and last letters are different
function() return false end,
} )[true]();
end;