summaryrefslogtreecommitdiff
path: root/module/system
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2011-12-04 21:56:13 +0100
committerAndy Wingo <wingo@pobox.com>2011-12-04 21:56:13 +0100
commit2aef6c2ba990c5829004c28cd410ba26a74c0597 (patch)
tree471f4f2f0ba7524417a035904329f32847678156 /module/system
parentd88f5323d10a09533a5b66bb8031a4e2b8e44313 (diff)
downloadguile-2aef6c2ba990c5829004c28cd410ba26a74c0597.tar.gz
,language at REPL sets current-language
* 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*.
Diffstat (limited to 'module/system')
-rw-r--r--module/system/repl/command.scm1
-rw-r--r--module/system/repl/repl.scm5
2 files changed, 5 insertions, 1 deletions
diff --git a/module/system/repl/command.scm b/module/system/repl/command.scm
index 3fead7cac..a709c8dd6 100644
--- a/module/system/repl/command.scm
+++ b/module/system/repl/command.scm
@@ -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)))
diff --git a/module/system/repl/repl.scm b/module/system/repl/repl.scm
index 1cffa7187..f7b022999 100644
--- a/module/system/repl/repl.scm
+++ b/module/system/repl/repl.scm
@@ -132,7 +132,10 @@
;;;
(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)