( defun palindrome-p ( str)
( let ( ( str ( remove-if-not #'alpha-char-p str) ) )
( string-equal str ( reverse str) ) ) )
( defun check-palindrome ( str)
( format t "~s is ~:[NOT ~;~]a palindrome.~%"
str ( palindrome-p str) ) )
( check-palindrome "boo" )
( check-palindrome "A man, a plan, a cat, a ham, a yak, a yam, a hat, a canal-Panama!" )
( check-palindrome "A tin mug for a jar of gum, Nita." )
( check-palindrome "A Toyota! Race fast, safe car! A Toyota!" )
KGRlZnVuIHBhbGluZHJvbWUtcCAoc3RyKQogIChsZXQgKChzdHIgKHJlbW92ZS1pZi1ub3QgIydhbHBoYS1jaGFyLXAgc3RyKSkpCiAgICAoc3RyaW5nLWVxdWFsIHN0ciAocmV2ZXJzZSBzdHIpKSkpCgooZGVmdW4gY2hlY2stcGFsaW5kcm9tZSAoc3RyKQogIChmb3JtYXQgdCAifnMgaXMgfjpbTk9UIH47fl1hIHBhbGluZHJvbWUufiUiCgkJICBzdHIgKHBhbGluZHJvbWUtcCBzdHIpKSkKCihjaGVjay1wYWxpbmRyb21lICJib28iKQooY2hlY2stcGFsaW5kcm9tZSAiQSBtYW4sIGEgcGxhbiwgYSBjYXQsIGEgaGFtLCBhIHlhaywgYSB5YW0sIGEgaGF0LCBhIGNhbmFsLVBhbmFtYSEiKQooY2hlY2stcGFsaW5kcm9tZSAiQSB0aW4gbXVnIGZvciBhIGphciBvZiBndW0sIE5pdGEuIikKKGNoZWNrLXBhbGluZHJvbWUgIkEgVG95b3RhISBSYWNlIGZhc3QsIHNhZmUgY2FyISBBIFRveW90YSEiKQ==
stdout
"boo" is NOT a palindrome.
"A man, a plan, a cat, a ham, a yak, a yam, a hat, a canal-Panama!" is a palindrome.
"A tin mug for a jar of gum, Nita." is a palindrome.
"A Toyota! Race fast, safe car! A Toyota!" is a palindrome.