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:
parent
cd713a0622
commit
6ae3499427
1 changed files with 13 additions and 0 deletions
|
@ -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."))))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue