summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Djurfeldt <djurfeldt@nada.kth.se>1999-03-19 02:15:43 +0000
committerMikael Djurfeldt <djurfeldt@nada.kth.se>1999-03-19 02:15:43 +0000
commit6ae34994276325a9750f12b8de9c6586e715b4af (patch)
treeb606402582bcbebdbe5992cb22726cb2d43dcab8
parentcd713a0622b858b9a43be86ca1d38af4a800950e (diff)
downloadguile-6ae34994276325a9750f12b8de9c6586e715b4af.tar.gz
* session.scm (system-module): New procedure. Used to switch a
module between system and user state.
-rw-r--r--ice-9/session.scm13
1 files changed, 13 insertions, 0 deletions
diff --git a/ice-9/session.scm b/ice-9/session.scm
index 27861649b..96f8268c0 100644
--- a/ice-9/session.scm
+++ b/ice-9/session.scm
@@ -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."))))))