* session.scm (system-module): New procedure. Used to switch a
authorMikael Djurfeldt <djurfeldt@nada.kth.se>
Fri, 19 Mar 1999 02:15:43 +0000 (02:15 +0000)
committerMikael Djurfeldt <djurfeldt@nada.kth.se>
Fri, 19 Mar 1999 02:15:43 +0000 (02:15 +0000)
module between system and user state.

ice-9/session.scm

index 2786164..96f8268 100644 (file)
                (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."))))))