Why not `length-cmp' which will -1 if less, 0 if equal, 1 if greater? (defun length-cmp (seq n) (let* ((len (if seq (if (consp seq) (let ((tlen 0)) (while (and seq (< tlen (1+ n))) (incf tlen) (setq seq (cdr seq))) tlen) (length seq)) 0))) (if (< len n) -1 (if (> len n) 1 0)))) All other functions can be build on top of it.