From f61204d5e13f2946c7bdde2565e4cc2edb0570d7 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Sun, 4 Dec 2011 15:31:03 +0900 Subject: [PATCH] Adding cond-expand to the initial empty environment along with import for writing portable scripts. --- main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 3f7a055d..82ef011f 100644 --- a/main.c +++ b/main.c @@ -409,7 +409,8 @@ void run_main (int argc, char **argv) { sexp_set_parameter(ctx, env, sym=sexp_intern(ctx, sexp_argv_symbol, -1), args); if (i < argc) { /* script usage */ #if SEXP_USE_MODULES - /* reset the environment to have only the `import' binding */ + /* reset the environment to have only the `import' and */ + /* `cond-expand' bindings */ if (!mods_loaded) { env = sexp_make_env(ctx); sexp_set_parameter(ctx, sexp_context_env(ctx), @@ -419,6 +420,9 @@ void run_main (int argc, char **argv) { tmp = sexp_env_ref(sexp_global(ctx, SEXP_G_META_ENV), sym, SEXP_VOID); sym = sexp_intern(ctx, "import", -1); sexp_env_define(ctx, env, sym, tmp); + sym = sexp_intern(ctx, "cond-expand", -1); + tmp = sexp_env_ref(sexp_global(ctx, SEXP_G_META_ENV), sym, SEXP_VOID); + sexp_env_define(ctx, env, sym, tmp); } #endif /* load the script */