mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-11 22:31:12 +02:00
add module-export-all!
* module/ice-9/boot-9.scm (module-export-all!): New function, exports all current and future local variables from a module.
This commit is contained in:
parent
4d67cd4073
commit
d2b7b761e5
1 changed files with 14 additions and 0 deletions
|
@ -3411,6 +3411,20 @@ module '(ice-9 q) '(make-q q-length))}."
|
|||
(module-add! public-i external-name var)))
|
||||
names)))
|
||||
|
||||
;; Export all local variables from a module
|
||||
;;
|
||||
(define (module-export-all! mod)
|
||||
(define (fresh-interface!)
|
||||
(let ((iface (make-module)))
|
||||
(set-module-name! iface (module-name mod))
|
||||
;; for guile 2: (set-module-version! iface (module-version mod))
|
||||
(set-module-kind! iface 'interface)
|
||||
(set-module-public-interface! mod iface)
|
||||
iface))
|
||||
(let ((iface (or (module-public-interface mod)
|
||||
(fresh-interface!))))
|
||||
(set-module-obarray! iface (module-obarray mod))))
|
||||
|
||||
;; Re-export a imported variable
|
||||
;;
|
||||
(define (module-re-export! m names)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue