aboutsummaryrefslogtreecommitdiff
path: root/rosetta/palindrome.neb
diff options
context:
space:
mode:
Diffstat (limited to 'rosetta/palindrome.neb')
-rw-r--r--rosetta/palindrome.neb6
1 files changed, 6 insertions, 0 deletions
diff --git a/rosetta/palindrome.neb b/rosetta/palindrome.neb
new file mode 100644
index 0000000..198456d
--- /dev/null
+++ b/rosetta/palindrome.neb
@@ -0,0 +1,6 @@
+(func palindrome? (str)
+ (branch
+ ((<= (length str) 1) #true)
+ ((eq? (first str) (last str))
+ (palindrome? (reverse (rest (reverse (rest str))))))
+ (#true #false)))