diff --git a/eval.c b/eval.c index 2d06a3d2..8f69bf56 100644 --- a/eval.c +++ b/eval.c @@ -2130,6 +2130,8 @@ void sexp_set_parameter (sexp ctx, sexp env, sexp name, sexp value) { sexp_opcode_data(param) = sexp_cons(ctx, name, value); else sexp_cdr(sexp_opcode_data(param)) = value; + } else { + sexp_warn(ctx, "can't set non-parameter: ", name); } } diff --git a/main.c b/main.c index ef45f02f..53675a60 100644 --- a/main.c +++ b/main.c @@ -183,7 +183,7 @@ static void repl (sexp ctx, sexp env) { out = sexp_param_ref(ctx, env, sexp_global(ctx, SEXP_G_CUR_OUT_SYMBOL)); err = sexp_param_ref(ctx, env, sexp_global(ctx, SEXP_G_CUR_ERR_SYMBOL)); if (!(sexp_iportp(in) && sexp_oportp(out) && sexp_oportp(err))) { - fprintf(stderr, "No standing I/O ports found, aborting. Maybe a bad -x language?\n"); + fprintf(stderr, "No standard I/O ports found, aborting. Maybe a bad -x language?\n"); exit_failure(); } sexp_port_sourcep(in) = 1; @@ -370,8 +370,8 @@ void run_main (int argc, char **argv) { tmp = check_exception(ctx, sexp_eval_string(ctx, impmod, -1, (c=='x' ? sexp_global(ctx, SEXP_G_META_ENV) : env))); free(impmod); if (c == 'x') { + sexp_set_parameter(ctx, env, sexp_global(ctx, SEXP_G_INTERACTION_ENV_SYMBOL), tmp); sexp_context_env(ctx) = env = tmp; - sexp_set_parameter(ctx, env, sexp_global(ctx, SEXP_G_INTERACTION_ENV_SYMBOL), env); } #endif break; @@ -475,7 +475,7 @@ void run_main (int argc, char **argv) { args = sexp_cons(ctx, tmp=sexp_c_string(ctx,argv[j],-1), args); if (i >= argc || no_script) args = sexp_cons(ctx, tmp=sexp_c_string(ctx,argv[0],-1), args); - sexp_set_parameter(ctx, env, sym=sexp_intern(ctx, sexp_argv_symbol, -1), args); + sexp_set_parameter(ctx, sexp_global(ctx, SEXP_G_META_ENV), sym=sexp_intern(ctx, sexp_argv_symbol, -1), args); if (i >= argc && main_symbol == NULL) { /* no script or main, run interactively */ repl(ctx, env);