summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-11-30 07:17:35 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-11-30 07:17:35 -0800
commit4acf4217af8e9c830f89e8586e5ec62e97cb85b0 (patch)
tree9973d4761a402f5ba6fa66a70c4e57243fe104cd
parente557f0f806badf93b36b2bf519a73830b67cf564 (diff)
downloadtxr-4acf4217af8e9c830f89e8586e5ec62e97cb85b0.tar.gz
txr-4acf4217af8e9c830f89e8586e5ec62e97cb85b0.tar.bz2
txr-4acf4217af8e9c830f89e8586e5ec62e97cb85b0.zip
Drop ctx_form param on env_vbind_special and apply.
* eval.c (env_vbind_special): Remove unused ctx_form parameter. (bind_args, bind_macro_params): Don't pass ctx_form to env_vbind_special. (apply): Remove unused ctx_form parameter. (apply_intrinsic, applyv, mapcarv, mappendv, lazy_mapcarv_func, mapdov, do_mapf): Don't pass nil third argument to apply. * eval.h (apply): Declaration updated. * lib.c (do_juxt): Do not bind third argument of apply to lin when currying; curry as two argument function. (do_not): Do not pass third nil argument to apply.
-rw-r--r--eval.c46
-rw-r--r--eval.h2
-rw-r--r--lib.c4
3 files changed, 26 insertions, 26 deletions
diff --git a/eval.c b/eval.c
index a8f61cff..a3a8b2ea 100644
--- a/eval.c
+++ b/eval.c
@@ -500,7 +500,7 @@ static val special_var_p(val sym)
}
static val env_vbind_special(val env, val sym, val obj,
- val special_list, val ctx_form)
+ val special_list)
{
if (special_list && memq(sym, special_list)) {
if (dyn_env)
@@ -585,17 +585,17 @@ static val bind_args(val env, val params, struct args *args, val ctx_form)
initval = arg;
present = t;
}
- env_vbind_special(new_env, param, initval, special_list, ctx_form);
+ env_vbind_special(new_env, param, initval, special_list);
if (presentsym)
- env_vbind_special(new_env, presentsym, present, special_list, ctx_form);
+ env_vbind_special(new_env, presentsym, present, special_list);
} else {
- env_vbind_special(new_env, param, arg, special_list, ctx_form);
+ env_vbind_special(new_env, param, arg, special_list);
}
}
if (bindable(params)) {
env_vbind_special(new_env, params, args_get_rest(args, index),
- special_list, ctx_form);
+ special_list);
} else if (consp(params)) {
if (car(params) == colon_k) {
if (optargs)
@@ -620,20 +620,20 @@ static val bind_args(val env, val params, struct args *args, val ctx_form)
car(ctx_form), sym, nao);
new_env = make_env(nil, nil, new_env);
- env_vbind_special(new_env, sym, initval, special_list, ctx_form);
+ env_vbind_special(new_env, sym, initval, special_list);
if (presentsym) {
if (!bindable(presentsym))
eval_error(ctx_form, lit("~s: ~s is not a bindable symbol"),
car(ctx_form), presentsym, nao);
- env_vbind_special(new_env, presentsym, nil, special_list, ctx_form);
+ env_vbind_special(new_env, presentsym, nil, special_list);
}
} else {
- env_vbind_special(new_env, param, nil, special_list, ctx_form);
+ env_vbind_special(new_env, param, nil, special_list);
}
params = cdr(params);
}
if (bindable(params))
- env_vbind_special(new_env, params, nil, special_list, ctx_form);
+ env_vbind_special(new_env, params, nil, special_list);
} else if (params) {
eval_error(ctx_form, lit("~s: ~s is not a bindable symbol"),
car(ctx_form), params, nao);
@@ -756,7 +756,7 @@ static val get_param_syms(val params)
}
}
-val apply(val fun, val arglist, val ctx_form)
+val apply(val fun, val arglist)
{
args_decl_list(args, ARGS_MIN, arglist);
return generic_funcall(fun, args);
@@ -779,7 +779,7 @@ static val apply_frob_args(val args)
val apply_intrinsic(val fun, val args)
{
- return apply(fun, apply_frob_args(z(args)), nil);
+ return apply(fun, apply_frob_args(z(args)));
}
static val applyv(val fun, struct args *args)
@@ -815,7 +815,7 @@ static val iapply(val fun, struct args *args)
}
}
- return apply(fun, z(mod_args), nil);
+ return apply(fun, z(mod_args));
}
static val list_star_intrinsic(struct args *args)
@@ -865,7 +865,7 @@ static val bind_macro_params(val env, val menv, val params, val form,
whole,
if3(param == form_k,
ctx_form, menv)),
- specials, ctx_form);
+ specials);
params = cdr(next);
continue;
}
@@ -885,7 +885,7 @@ static val bind_macro_params(val env, val menv, val params, val form,
}
if (bindable(param)) {
- env_vbind_special(new_env, param, car(form), specials, ctx_form);
+ env_vbind_special(new_env, param, car(form), specials);
} else if (consp(param)) {
if (optargs) {
val nparam = pop(&param);
@@ -903,7 +903,7 @@ static val bind_macro_params(val env, val menv, val params, val form,
nparam, car(form), t, ctx_form);
if (presentsym)
- env_vbind_special(new_env, presentsym, t, specials, ctx_form);
+ env_vbind_special(new_env, presentsym, t, specials);
} else {
new_env = bind_macro_params(new_env, menv,
param, car(form),
@@ -937,7 +937,7 @@ static val bind_macro_params(val env, val menv, val params, val form,
noarg:
if (bindable(param)) {
- env_vbind_special(new_env, param, nil, specials, ctx_form);
+ env_vbind_special(new_env, param, nil, specials);
} else if (consp(param)) {
val nparam = pop(&param);
val initform = pop(&param);
@@ -958,7 +958,7 @@ noarg:
}
if (presentsym)
- env_vbind_special(new_env, presentsym, nil, specials, ctx_form);
+ env_vbind_special(new_env, presentsym, nil, specials);
} else {
err_sym = param;
goto nbind;
@@ -972,7 +972,7 @@ noarg:
err_sym = params;
goto nbind;
}
- env_vbind_special(new_env, params, form, specials, ctx_form);
+ env_vbind_special(new_env, params, form, specials);
goto out;
}
@@ -3523,7 +3523,7 @@ val mapcarv(val fun, struct args *lists)
deref(car_l(iter)) = cdr(list);
}
- otail = list_collect(otail, apply(fun, z(args), nil));
+ otail = list_collect(otail, apply(fun, z(args)));
}
}
}
@@ -3558,7 +3558,7 @@ static val mappendv(val fun, struct args *lists)
deref(car_l(iter)) = cdr(list);
}
- otail = list_collect_append(otail, apply(fun, z(args), nil));
+ otail = list_collect_append(otail, apply(fun, z(args)));
}
}
}
@@ -3591,7 +3591,7 @@ static val lazy_mapcarv_func(val env, val lcons)
val args = mapcar(car_f, lofl);
val next = mapcar(cdr_f, lofl);
- rplaca(lcons, apply(fun, z(args), nil));
+ rplaca(lcons, apply(fun, z(args)));
rplacd(env, next);
if (all_satisfy(next, identity_f, identity_f))
@@ -3651,7 +3651,7 @@ static val mapdov(val fun, struct args *lists)
deref(car_l(iter)) = cdr(list);
}
- apply(fun, z(args), nil);
+ apply(fun, z(args));
}
}
}
@@ -4179,7 +4179,7 @@ static val do_mapf(val env, struct args *args)
{
cons_bind (fun, funlist, env);
val mapped_args = mapcarl(call_f, cons(funlist, cons(args_get_list(args), nil)));
- return apply(fun, z(mapped_args), nil);
+ return apply(fun, z(mapped_args));
}
static val mapf(val fun, struct args *funlist)
diff --git a/eval.h b/eval.h
index 7dd51121..311cc8ac 100644
--- a/eval.h
+++ b/eval.h
@@ -52,7 +52,7 @@ val func_get_name(val fun, val env);
void reg_varl(val sym, val val);
void reg_var(val sym, val val);
void reg_fun(val sym, val fun);
-val apply(val fun, val arglist, val ctx_form);
+val apply(val fun, val arglist);
val apply_intrinsic(val fun, val args);
val eval_progn(val forms, val env, val ctx_form);
val eval(val form, val env, val ctx_form);
diff --git a/lib.c b/lib.c
index bd172bf8..ee6c270d 100644
--- a/lib.c
+++ b/lib.c
@@ -5447,7 +5447,7 @@ val chandv(struct args *funlist)
static val do_juxt(val funcs, struct args *args)
{
- return mapcar(curry_123_1(func_n3(apply), args_get_list(args), nil), funcs);
+ return mapcar(curry_12_1(func_n2(apply), args_get_list(args)), funcs);
}
val juxtv(struct args *funlist)
@@ -5553,7 +5553,7 @@ val orv(struct args *funlist)
static val do_not(val fun, struct args *args)
{
- return null(apply(fun, args_get_list(args), nil));
+ return null(apply(fun, args_get_list(args)));
}
val notf(val fun)