-(defmacro export-from-file (file)
- `(export ',(list-autoexported-symbols-in-file file)))
-
+(defmacro export-from-file (file &optional package)
+ (if package
+ `(export ',(list-autoexported-symbols-in-file file) ,package)
+ `(export ',(list-autoexported-symbols-in-file file))))
+
+(defmacro export-from-files (files &optional package)
+ `(progn
+ ,@(loop for file in files collect `(export-from-file ,file ,package))))
+
+(defun copy-hash-table (hash-table)
+ (let ((new-hash-table (make-hash-table
+ :test (hash-table-test hash-table)
+ :size (hash-table-size hash-table))))
+ (maphash
+ #'(lambda (key value)
+ (setf (gethash key new-hash-table) value))
+ hash-table)
+ new-hash-table))
+
+(defmacro with-export-handlers (&body body)
+ `(let ((*export-handlers* (copy-hash-table *export-handlers*)))
+ ,@body))
+