```Example solutions
;; list -> integer
(defun length (lst)
(if (endp lst)
0
(+ 1 (length (cdr lst)))))
or
;; list -> integer -> integer
(defun length-tail (lst n)
(if (endp lst)
n
(length-tail (cdr lst) (+ n 1))))
;; list -> number
(defun length (lst n)
(length lst 0))

;; list -> list -> list
(defun reverse-tail (x y)
(if (endp x)
y
(reverse-tail (cdr x) (cons (car x) y))))
;; list -> list
(defun reverse (x)
(reverse-tail x nil))

or
;; list -> list
(defun reverse (lst)
(if (endp lst)
nil
(append (reverse (cdr lst)) (list (car lst)))))

;; list -> number
(defun sum-list (lst)
(if (endp lst)
0
(+ (car lst) (sum-list (cdr lst)))))

or
;; list -> number -> list
(defun sum-list-tail (lst n)
(if (endp lst)
n
(sum-list-tail (cdr lst) (+ n (car lst)))))
;; list -> number
(defun sum-list (lst)
(sum-list-tail lst 0))

;; list -> list -> integer -> list
(defun rotate-tail (x y n)
(if (zp n)
(append x (reverse y))
(rotate-tail (cdr x) (cons (car x) y) (- n 1))))
;; list -> number -> list
(defun rotate (lst n)
(cond ((< n 0) (rotate lst (+ (length lst) n)))
((zp n) lst)
(t (rotate-tail lst nil (mod n (length lst))))))

or
;; list -> integer -> list
(defun first-n (lst n)
(if (or (endp lst) (<= n 0))
nil
(cons (car lst) (first-n (cdr lst) (- n 1)))))
;; list -> integer -> list
(defun nth-cdr (lst n)
(if (or (endp lst) (<= n 0))
lst
(nth-cdr (cdr lst) (- n 1))))
;; list -> integer -> list
(defun rotate (lst n)
(append (nth-cdr lst (- (length lst) n)) (first-n lst n)))

or
;; list -> integer -> list
(defun rotate (lst n)
(if (or (zp n) (< n 0))
lst
(rotate (append (cdr lst) (list (car lst))) (- n 1))))
```