add DROP, similar to Clojure counterpart.

This commit is contained in:
Kyle Isom 2015-04-21 02:53:04 -06:00
parent 131b9848e9
commit 2b46bc5867
2 changed files with 7 additions and 0 deletions

View File

@ -15,6 +15,12 @@
(when (> n 0) (when (> n 0)
(rec n lst nil)))) (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) (defun interpose (x sep)
"Takes a list and a separator, and places separator between element "Takes a list and a separator, and places separator between element
of the list." of the list."

View File

@ -10,6 +10,7 @@
#:defmacro! ; Let Over Lambda utilities #:defmacro! ; Let Over Lambda utilities
#:interpose ; My utilities #:interpose ; My utilities
#:take #:take
#:drop
#:build-list #:build-list
#:partial #:partial
#:macroexpand-n #:macroexpand-n