Add SEQUENCEP.
[jscl.git] / src / utils.lisp
index 5cb702c..6ab351d 100644 (file)
@@ -18,9 +18,6 @@
 
 (/debug "loading utils.lisp!")
 
-(defvar *newline* "
-")
-
 (defmacro concatf (variable &body form)
   `(setq ,variable (concat ,variable (progn ,@form))))
 
   (let ((key-val (if key (funcall key y) y))
         (fn (if test-not-p (complement test-not) test)))
     (funcall fn x key-val)))
+
+
+(defun interleave (list element &optional after-last-p)
+  (unless (null list)
+    (with-collect
+      (collect (car list))
+      (dolist (x (cdr list))
+        (collect element)
+        (collect x))
+      (when after-last-p
+        (collect element)))))