Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
14 lines (12 sloc) 324 Bytes
; P06 Find out whether a list is a palindrome.
; A palindrome can be read forward or backward; e.g. (x a m a x).
; Tail recursion
(defn f1 [l]
(or (empty? l)
(empty? (rest l))
(and
(= (first l) (last l))
(recur (butlast (rest l))))))
; Builtin "reverse"
(defn f2 [l]
(= l (reverse l)))