,language at REPL sets current-language
authorAndy Wingo <wingo@pobox.com>
Sun, 4 Dec 2011 20:56:13 +0000 (21:56 +0100)
committerAndy Wingo <wingo@pobox.com>
Sun, 4 Dec 2011 20:56:13 +0000 (21:56 +0100)
* module/system/repl/command.scm (language): Set the
  *current-language*.
* module/system/repl/repl.scm (start-repl): Create a new dynamic scope
  for *current-language*.

module/system/repl/command.scm
module/system/repl/repl.scm

index 3fead7c..a709c8d 100644 (file)
@@ -441,6 +441,7 @@ Change languages."
         (cur (repl-language repl)))
     (format #t "Happy hacking with ~a!  To switch back, type `,L ~a'.\n"
             (language-title lang) (language-name cur))
+    (fluid-set! *current-language* lang)
     (set! (repl-language repl) lang)))
 
 \f
index 1cffa71..f7b0229 100644 (file)
 ;;;
 
 (define* (start-repl #:optional (lang (current-language)) #:key debug)
-  (run-repl (make-repl lang debug)))
+  ;; ,language at the REPL will fluid-set! the *current-language*.  Make
+  ;; sure that it does so in a new scope.
+  (with-fluids ((*current-language* lang))
+    (run-repl (make-repl lang debug))))
 
 ;; (put 'abort-on-error 'scheme-indent-function 1)
 (define-syntax-rule (abort-on-error string exp)