diff --git a/kutils.lisp b/kutils.lisp index 6439557..18e59b3 100644 --- a/kutils.lisp +++ b/kutils.lisp @@ -15,6 +15,12 @@ (when (> n 0) (rec n lst nil)))) +(defun drop (n lst) + "Drop n elements from the list." + (if (or (<= n 0) (null lst)) + lst + (drop (- n 1) (cdr lst)))) + (defun interpose (x sep) "Takes a list and a separator, and places separator between element of the list." diff --git a/package.lisp b/package.lisp index 5174cc4..7672002 100644 --- a/package.lisp +++ b/package.lisp @@ -10,6 +10,7 @@ #:defmacro! ; Let Over Lambda utilities #:interpose ; My utilities #:take + #:drop #:build-list #:partial #:macroexpand-n