mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-20 22:29:16 +02:00
repl creates a new env so new definitions don't show in the standard env
This commit is contained in:
parent
725316ad3c
commit
a1566b79d0
1 changed files with 7 additions and 4 deletions
11
main.c
11
main.c
|
@ -1,6 +1,6 @@
|
|||
/* main.c -- chibi-scheme command-line app */
|
||||
/* Copyright (c) 2009 Alex Shinn. All rights reserved. */
|
||||
/* BSD-style license: http://synthcode.com/license.txt */
|
||||
/* main.c -- chibi-scheme command-line app */
|
||||
/* Copyright (c) 2009-2010 Alex Shinn. All rights reserved. */
|
||||
/* BSD-style license: http://synthcode.com/license.txt */
|
||||
|
||||
#include "chibi/eval.h"
|
||||
|
||||
|
@ -22,7 +22,10 @@ static void repl (sexp ctx) {
|
|||
sexp in, out, err;
|
||||
sexp_gc_var4(obj, tmp, res, env);
|
||||
sexp_gc_preserve4(ctx, obj, tmp, res, env);
|
||||
env = sexp_context_env(ctx);
|
||||
env = sexp_make_env(ctx);
|
||||
sexp_env_parent(env) = sexp_context_env(ctx);
|
||||
sexp_env_define(ctx, sexp_context_env(ctx),
|
||||
sexp_global(ctx, SEXP_G_INTERACTION_ENV_SYMBOL), env);
|
||||
sexp_context_tracep(ctx) = 1;
|
||||
in = sexp_eval_string(ctx, "(current-input-port)", env);
|
||||
out = sexp_eval_string(ctx, "(current-output-port)", env);
|
||||
|
|
Loading…
Add table
Reference in a new issue