mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-18 17:50:29 +02:00
* 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.)
This commit is contained in:
parent
39bc994824
commit
a0cc0a0125
2 changed files with 23 additions and 0 deletions
|
@ -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)'.
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue