diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog index 85d9c062e..5471899df 100644 --- a/ice-9/ChangeLog +++ b/ice-9/ChangeLog @@ -1,3 +1,13 @@ +1998-07-16 Mikael Djurfeldt + + * 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 * boot-9.scm: Renamed module `(guile-repl)' --> `(guile-user)'. diff --git a/ice-9/boot-9.scm b/ice-9/boot-9.scm index c560877cd..9796b67a4 100644 --- a/ice-9/boot-9.scm +++ b/ice-9/boot-9.scm @@ -2798,6 +2798,19 @@ (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)