diff --git a/xcvb-utils.lisp b/xcvb-utils.lisp index 47a52366b51b2036fb10f17f799d5d32b1a212f7..88a6bfd50caab879649d6fe9247fcd49aadd5ae7 100644 --- a/xcvb-utils.lisp +++ b/xcvb-utils.lisp @@ -9,27 +9,5 @@ (in-package :fare-utils) -(defmacro define-package-mix (package mixed-packages &rest clauses) - (let ((h (make-hash-table :test 'equal))) - (labels ((ensure-imported (n) - (let* ((s (string n)) - (x (gethash s h))) - (unless x (setf (gethash s h) t)) - x)) - (import-from (package) - (loop :for s :being :each :external-symbol :in package - :for n = (symbol-name s) - :unless (ensure-imported n) - :collect n))) - ;; First, mark the symbols explicitly imported by the user - (loop :for (kw . ()) :in clauses - :when (member kw '(:import-from :shadowing-import-from)) :do - (map () #'ensure-imported (cddr clauses))) - `(defpackage ,package - ,@(loop :for p :in mixed-packages - :collect `(:import-from ,p ,@(import-from p))) - ,@clauses - (:export ,@(loop :for s :being :the :hash-keys :of h :collect s)))))) - (define-package-mix :xcvb-utils (:alexandria :xcvb-driver :asdf-utils :fare-utils))