/*set_tflag(t_lambda, tflag_infer);*/
GWI_BB(gwi_set_global_type(gwi, t_lambda, et_lambda))
- gwidoc(gwi, "Mark function as curried.");
- const Type t_curry = gwi_mk_type(gwi, "@Curry", 0, NULL);
- GWI_BB(gwi_set_global_type(gwi, t_curry, et_curry))
+ gwidoc(gwi, "Mark function as apms.");
+ const Type t_apms = gwi_mk_type(gwi, "@apms", 0, NULL);
+ GWI_BB(gwi_set_global_type(gwi, t_apms, et_apms))
gwidoc(gwi, "type for internal pointer data.");
GWI_BB(gwi_typedef_ini(gwi, "int", "@internal"))
return ret;
}
-ANN static Exp order_curry(const Env env, Exp fn, const Exp _arg) {
+ANN static Exp order_apms(const Env env, Exp fn, const Exp _arg) {
const MemPool mp = env->gwion->mp;
Exp base = NULL;
Exp next = NULL;
return base;
}
-static OP_CHECK(opck_curry) {
+static OP_CHECK(opck_apms) {
Exp_Binary *bin = (Exp_Binary *)data;
Exp lhs = bin->lhs;
Exp_Call base = bin->rhs->d.exp_call;
- DECL_ON(const Exp, args, = order_curry(env, base.args, lhs));
+ DECL_ON(const Exp, args, = order_apms(env, base.args, lhs));
Exp_Call call = {.func = base.func, .args = args};
Exp e = exp_self(bin);
e->exp_type = ae_exp_call;
GWI_BB(gwi_oper_ini(gwi, (m_str)OP_ANY_TYPE, "@function", NULL))
GWI_BB(gwi_oper_add(gwi, opck_func_call))
GWI_BB(gwi_oper_end(gwi, "=>", NULL))
- GWI_BB(gwi_oper_ini(gwi, (m_str)OP_ANY_TYPE, "@Curry", NULL))
- GWI_BB(gwi_oper_add(gwi, opck_curry))
+ GWI_BB(gwi_oper_ini(gwi, (m_str)OP_ANY_TYPE, "@apms", NULL))
+ GWI_BB(gwi_oper_add(gwi, opck_apms))
GWI_BB(gwi_oper_end(gwi, "=>", NULL))
GWI_BB(gwi_oper_ini(gwi, NULL, "@func_ptr", "bool"))
GWI_BB(gwi_oper_end(gwi, "!", IntNot))
return GW_ERROR;
}
-ANN2(1) static inline bool curried(const Env env, Exp exp) {
+ANN2(1) static inline bool apms(const Env env, Exp exp) {
while (exp) {
if (is_hole(env, exp))
return true;
}
ANN static Type check_exp_call(const Env env, Exp_Call *exp) {
- if (exp->apms && curried(env, exp->args))
- return env->gwion->type[et_curry];
+ if (exp->apms && apms(env, exp->args))
+ return env->gwion->type[et_apms];
if (exp->tmpl) {
DECL_BO(const m_bool, ret, = func_check(env, exp));
if (!ret) return exp_self(exp)->type;