* boot-9.scm (export, export-syntax): New special forms: Export
authorMikael Djurfeldt <djurfeldt@nada.kth.se>
Wed, 15 Jul 1998 23:01:45 +0000 (23:01 +0000)
committerMikael Djurfeldt <djurfeldt@nada.kth.se>
Wed, 15 Jul 1998 23:01:45 +0000 (23:01 +0000)
bindings from a module.  `(export name1 name2 ...)' can be used at
the top of a module (after `define-module') to specify which names
should be exported.  It can be used as an alternative to
`define-public'.  `export-syntax' works equivalently to `export'
but is intended for export of syntactic keywords.
(Thanks to Thien-Thi Nguyen.)

ice-9/ChangeLog
ice-9/boot-9.scm

index 85d9c06..5471899 100644 (file)
@@ -1,3 +1,13 @@
+1998-07-16  Mikael Djurfeldt  <mdj@barbara.nada.kth.se>
+
+       * boot-9.scm (export, export-syntax): New special forms: Export
+       bindings from a module.  `(export name1 name2 ...)' can be used at
+       the top of a module (after `define-module') to specify which names
+       should be exported.  It can be used as an alternative to
+       `define-public'.  `export-syntax' works equivalently to `export'
+       but is intended for export of syntactic keywords.
+       (Thanks to Thien-Thi Nguyen.)
+
 1998-07-15  Mikael Djurfeldt  <mdj@barbara.nada.kth.se>
 
        * boot-9.scm: Renamed module `(guile-repl)' --> `(guile-user)'.
index c560877..9796b67 100644 (file)
                             (defmacro ,@ args))))))
 
 
+(defmacro export names
+  `(let* ((m (current-module))
+         (public-i (module-public-interface m)))
+     (for-each (lambda (name)
+                ;; Make sure there is a local variable:
+                (module-define! m name (module-ref m name #f))
+                ;; Make sure that local is exported:
+                (module-add! public-i name (module-variable m name)))
+              ',names)))
+
+(define export-syntax export)
+
+
 
 
 (define load load-module)