mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 05:50:26 +02:00
Fix REPL environment for languages other than scheme.
* module/system/repl/common.scm (repl-compile): Use `#:env #f' for languages other than scheme.
This commit is contained in:
parent
3245c0fbef
commit
30e73c7698
1 changed files with 9 additions and 3 deletions
|
@ -67,9 +67,15 @@
|
||||||
(let ((to (lookup-language (cond ((memq #:e opts) 'scheme)
|
(let ((to (lookup-language (cond ((memq #:e opts) 'scheme)
|
||||||
((memq #:t opts) 'ghil)
|
((memq #:t opts) 'ghil)
|
||||||
((memq #:c opts) 'glil)
|
((memq #:c opts) 'glil)
|
||||||
(else 'objcode)))))
|
(else 'objcode))))
|
||||||
(compile form #:from (repl-language repl) #:to to #:opts opts
|
(from (repl-language repl)))
|
||||||
#:env (current-module))))
|
(compile form #:from from #:to to #:opts opts
|
||||||
|
;; XXX: Languages other than Scheme may not support having
|
||||||
|
;; a module as the environment, so work around that. See
|
||||||
|
;; also `language-default-environment'.
|
||||||
|
#:env (if (eq? from (lookup-language 'scheme))
|
||||||
|
(current-module)
|
||||||
|
#f))))
|
||||||
|
|
||||||
(define (repl-parse repl form)
|
(define (repl-parse repl form)
|
||||||
(let ((parser (language-parser (repl-language repl))))
|
(let ((parser (language-parser (repl-language repl))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue