1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-03 10:40:21 +02:00

* session.scm (system-module): New procedure. Used to switch a

module between system and user state.
This commit is contained in:
Mikael Djurfeldt 1999-03-19 02:15:43 +00:00
parent cd713a0622
commit 6ae3499427

View file

@ -158,3 +158,16 @@
(display formals)
(display #\')))))
(display ".\n")))
(define-public system-module
(procedure->syntax
(lambda (exp env)
(let* ((m (nested-ref the-root-module
(append '(app modules) (cadr exp)))))
(if (not m)
(error "Couldn't find any module named" (cadr exp)))
(let ((s (not (procedure-property (module-eval-closure m)
'system-module))))
(set-system-module! m s)
(string-append "Module " (symbol->string (module-name m))
" is now a " (if s "system" "user") " module."))))))