add DROP, similar to Clojure counterpart.
This commit is contained in:
parent
131b9848e9
commit
2b46bc5867
|
@ -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."
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue