Merge branch 'codegen'
[jscl.git] / src / utils.lisp
index aa097af..d380e4c 100644 (file)
@@ -16,6 +16,8 @@
 ;; You should have received a copy of the GNU General Public License
 ;; along with JSCL.  If not, see <http://www.gnu.org/licenses/>.
 
+(/debug "loading utils.lisp!")
+
 (defvar *newline* "
 ")
 
   (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)))))