chiark / gitweb /
Added new macro EXPORT-FROM-SYSTEM
authorespen <espen>
Wed, 2 Jan 2008 15:39:00 +0000 (15:39 +0000)
committerespen <espen>
Wed, 2 Jan 2008 15:39:00 +0000 (15:39 +0000)
tools/autoexport.lisp

index 6a1c13c..72cdeba 100644 (file)
@@ -3,7 +3,7 @@ (defpackage "AUTOEXPORT"
   (:export "LIST-AUTOEXPORTED-SYMBOLS" "LIST-AUTOEXPORTED-SYMBOLS-IN-FILE"
           "DEFEXPORT" "EXPORT-FROM-FILE" "EXPORT-FROM-FILES" "INTERNAL"
           "WITH-EXPORT-HANDLERS" "EXPORT-HANDLER-MAKUNBOUND"
   (:export "LIST-AUTOEXPORTED-SYMBOLS" "LIST-AUTOEXPORTED-SYMBOLS-IN-FILE"
           "DEFEXPORT" "EXPORT-FROM-FILE" "EXPORT-FROM-FILES" "INTERNAL"
           "WITH-EXPORT-HANDLERS" "EXPORT-HANDLER-MAKUNBOUND"
-          "EXPORT-DEFCLASS-FORM"))
+          "EXPORT-DEFCLASS-FORM" "EXPORT-FROM-SYSTEM"))
 
 (in-package "AUTOEXPORT")
 
 
 (in-package "AUTOEXPORT")
 
@@ -66,6 +66,15 @@ (defmacro export-from-files (files &optional package)
   `(progn 
      ,@(loop for file in files collect `(export-from-file ,file ,package))))
 
   `(progn 
      ,@(loop for file in files collect `(export-from-file ,file ,package))))
 
+(defmacro export-from-system (&optional package)
+  (let ((depends-on (cdar (asdf:component-depends-on asdf:*operation* asdf:*component*))))
+    `(progn 
+       ,@(loop
+         for component in depends-on
+         as pathname = (asdf:component-pathname 
+                        (asdf:find-component asdf:*system* component))
+         collect `(export-from-file ,pathname ,package)))))
+
 (defun copy-hash-table (hash-table)
   (let ((new-hash-table (make-hash-table 
                         :test (hash-table-test hash-table)
 (defun copy-hash-table (hash-table)
   (let ((new-hash-table (make-hash-table 
                         :test (hash-table-test hash-table)