Simplified Common Lisp reference
butlast
Symbol class: Conses, Lists and related functions
Syntax:
Symbol type: function
butlastlistn(optional) => list
Argument description:
list a list
n a non-negative integer, default is 1

BUTLAST function returns the argument list copy without N last elements. See LAST.

(butlast '(1 2 3)) => (1 2)
(butlast '(1 2 3) 0) => (1 2 3)
(butlast '(1 2 3) 1) => (1 2)
(butlast '(1 2 3) 2) => (1)
(butlast '(1 2 3) 3) => NIL
(butlast '(1 2 3) 4) => NIL
Function indexFull documentation for butlast (HyperSpec)