From 5904cf167cb4a6e109071f8624a6b8e702754b09 Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Fri, 10 Apr 2015 19:40:59 -0700 Subject: [PATCH] Cleanup defclass!, interpose. --- kutils.lisp | 20 +++++++++++--------- package.lisp | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/kutils.lisp b/kutils.lisp index ef80332..261802a 100644 --- a/kutils.lisp +++ b/kutils.lisp @@ -9,9 +9,11 @@ (defun interpose (x sep) "Takes a list and a separator, and places separator between element of the list." - (mapcar (lambda (y) - (list y sep)) - x)) + (let ((x (coerce x 'list))) + (apply #'append + (mapcar (lambda (y) + (list y sep)) + x)))) (defun build-list (arg) "If arg is an atom, return it as a list. If it's a list, return the @@ -73,12 +75,12 @@ additional args provided to the lambda." (body (if docstring (rest body) body)) (slots (if (null slots) '() - (apply #'build-slot-list name slots))) - (args (build-arg-list slots))) - `(defclass ,name ,superclass - ,slots - ,docstring - ,@body))) + (apply #'build-slot-list name slots)))) + `(closer-mop:ensure-finalized + (defclass ,name ,superclass + ,slots + ,docstring + ,@body)))) (defmacro defconstructor (class-name) (let* ((class (find-class class-name)) diff --git a/package.lisp b/package.lisp index fff52a8..590d120 100644 --- a/package.lisp +++ b/package.lisp @@ -8,7 +8,7 @@ #:flatten #:compose #:defmacro! ; Let Over Lambda utilities - #:join ; My utilities + #:interpose ; My utilities #:build-list #:partial #:macroexpand-n