std-butlast | ![]() |
std-butlast returns the list without the last element, the complement to cdr.
It is not the same as (std-remove (last lst) lst)
, which would remove all elements that are equal to the last (all possible duplicates also), but equal to (std-delpos (1- (length lst)) lst)
only implemented more efficiently.
(std-butlast nil)
returns nil.
On not list arguments a bad argument type error is thrown.
(std-butlast '(0 1 2 3)) => (0 1 2) (std-butlast '(0)) => nil (std-butlast nil) => nil
lst: any proper list.
A list.
None.
(std-require 'STDLIST)
Defined in STDLIST