diff --git a/core/compile.c b/core/compile.c index fa8bd7c6..dca3ccb1 100644 --- a/core/compile.c +++ b/core/compile.c @@ -529,9 +529,9 @@ static Slot compile_symbol(GstCompiler *c, FormOptions opts, GstValue sym) { const GstValue *tup; Gst *vm= c->vm; GstValue *t = gst_tuple_begin(vm, 3); - t[0] = gst_string_cv(vm, "get"); /* Todo - replace with ref ro actual cfunc */ + t[0] = gst_string_cv(vm, "get"); /* Todo - replace with actual cfunc or bytecode */ t[1] = quote(vm, lit); - t[2] = quote(vm, sym); + t[2] = gst_wrap_integer(0); tup = gst_tuple_end(vm, t); return compile_value(c, opts, gst_wrap_tuple(tup)); } else if (level > 0) { @@ -610,7 +610,7 @@ static Slot compile_assign(GstCompiler *c, FormOptions opts, GstValue left, GstV GstValue *t = gst_tuple_begin(vm, 4); t[0] = gst_string_cv(vm, "set!"); /* Todo - replace with ref ro actual cfunc */ t[1] = quote(vm, lit); - t[2] = quote(vm, left); + t[2] = gst_wrap_integer(0); t[3] = right; tup = gst_tuple_end(vm, t); subOpts.resultUnused = 1; diff --git a/core/util.c b/core/util.c index dbb1e11e..6b81d7d8 100644 --- a/core/util.c +++ b/core/util.c @@ -274,10 +274,6 @@ GstTable *gst_env_meta(Gst *vm, GstTable *env) { return gst_env_inttab(vm, env, GST_ENV_METADATA); } -GstTable *gst_env_vars(Gst *vm, GstTable *env) { - return gst_env_inttab(vm, env, GST_ENV_VARS); -} - /* Add many global variables and bind to nil */ static void mergenils(Gst *vm, GstTable *destEnv, GstTable *nils) { const GstValue *data = nils->data; @@ -347,9 +343,10 @@ void gst_env_putc(Gst *vm, GstTable *env, const char *key, GstValue value) { void gst_env_putvar(Gst *vm, GstTable *env, GstValue key, GstValue value) { GstTable *meta = gst_env_meta(vm, env); GstTable *newmeta = gst_table(vm, 4); - GstTable *vars = gst_env_vars(vm, env); - gst_table_put(vm, vars, key, value); - gst_table_put(vm, env, key, gst_wrap_table(vars)); + GstArray *ref = gst_array(vm, 1); + ref->count = 1; + ref->data[0] = value; + gst_table_put(vm, env, key, gst_wrap_array(ref)); gst_table_put(vm, newmeta, gst_string_cv(vm, "mutable"), gst_wrap_boolean(1)); gst_table_put(vm, meta, key, gst_wrap_table(newmeta)); } diff --git a/include/gst/gst.h b/include/gst/gst.h index 650d2d38..61c3b11e 100644 --- a/include/gst/gst.h +++ b/include/gst/gst.h @@ -645,7 +645,6 @@ GstInteger gst_endrange(GstInteger raw, uint32_t len); void gst_env_merge(Gst *vm, GstTable *destEnv, GstTable *srcEnv); GstTable *gst_env_nils(Gst *vm, GstTable *env); GstTable *gst_env_meta(Gst *vm, GstTable *env); -GstTable *gst_env_vars(Gst *vm, GstTable *env); void gst_env_put(Gst *vm, GstTable *env, GstValue key, GstValue value); void gst_env_putc(Gst *vm, GstTable *env, const char *key, GstValue value); void gst_env_putvar(Gst *vm, GstTable *env, GstValue key, GstValue value);