[bugfix] repl broken
This commit is contained in:
parent
9433bace1f
commit
0fe4df3c15
|
@ -19,6 +19,8 @@
|
||||||
(define (add-history str)
|
(define (add-history str)
|
||||||
#f))))
|
#f))))
|
||||||
|
|
||||||
|
(define user-env (library-environment (find-library '(picrin user))))
|
||||||
|
|
||||||
(eval
|
(eval
|
||||||
'(import (scheme base)
|
'(import (scheme base)
|
||||||
(scheme load)
|
(scheme load)
|
||||||
|
@ -33,7 +35,7 @@
|
||||||
(picrin macro)
|
(picrin macro)
|
||||||
(picrin array)
|
(picrin array)
|
||||||
(picrin library))
|
(picrin library))
|
||||||
(library-environment (find-library '(picrin user))))
|
user-env)
|
||||||
|
|
||||||
(define (repl)
|
(define (repl)
|
||||||
(let loop ((buf ""))
|
(let loop ((buf ""))
|
||||||
|
@ -63,7 +65,7 @@
|
||||||
(lambda (port)
|
(lambda (port)
|
||||||
(let next ((expr (read port)))
|
(let next ((expr (read port)))
|
||||||
(unless (eof-object? expr)
|
(unless (eof-object? expr)
|
||||||
(write (eval expr '(picrin user)))
|
(write (eval expr user-env))
|
||||||
(newline)
|
(newline)
|
||||||
(set! str "")
|
(set! str "")
|
||||||
(next (read port))))))))))
|
(next (read port))))))))))
|
||||||
|
|
Loading…
Reference in New Issue