mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Make additional icyc modules visible in repl
By recreating a fresh global environment after all imports have been processed, and passing this to eval, all modules loaded by icyc are available to eval.
This commit is contained in:
parent
5c9651c5df
commit
1c87635236
2 changed files with 4 additions and 1 deletions
4
icyc.scm
4
icyc.scm
|
@ -7,6 +7,7 @@
|
|||
(import (scheme cyclone common)
|
||||
(scheme base)
|
||||
(scheme char)
|
||||
(scheme load)
|
||||
(scheme read)
|
||||
(scheme write)
|
||||
(scheme eval))
|
||||
|
@ -15,6 +16,7 @@
|
|||
(display *Cyc-version-banner*))
|
||||
(else #f))
|
||||
|
||||
(define *icyc-env* (setup-environment))
|
||||
(define (repl:next-line)
|
||||
(call/cc
|
||||
(lambda (k)
|
||||
|
@ -38,7 +40,7 @@
|
|||
|
||||
(define (repl)
|
||||
(display "cyclone> ")
|
||||
(let ((c (eval (read))))
|
||||
(let ((c (eval (read) *icyc-env*)))
|
||||
(cond
|
||||
((not (eof-object? c))
|
||||
(write c)
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
;environment
|
||||
eval
|
||||
create-environment ; non-standard
|
||||
setup-environment ; non-standard
|
||||
)
|
||||
(begin
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue