aboutsummaryrefslogtreecommitdiff
path: root/rosetta/palindrome.neb
blob: 3f8bf8d830edca937fa051f82c4d39eeddcdd3d9 (plain)
1
2
3
4
5
6
7
; the answer in p99/p06 is better
(func palindrome? (str)
    (branch
        ((<= (length str) 1) #true)
        ((eq? (first str) (last str))
            (palindrome? (reverse (rest (reverse (rest str))))))
        (#true #false)))