From: Jérémie Astor Date: Mon, 18 Apr 2022 01:04:45 +0000 (+0200) Subject: :art: Remove ambiguity with apms X-Git-Tag: nightly~303 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=e0a1ad616b4b7a0514fd8b2d23ed44f63be188da;p=gwion.git :art: Remove ambiguity with apms --- diff --git a/include/env/type.h b/include/env/type.h index e0b58c85..23938edf 100644 --- a/include/env/type.h +++ b/include/env/type.h @@ -140,7 +140,7 @@ typedef enum { et_union, et_auto, et_none, - et_curry, + et_apms, et_dict, MAX_TYPE } type_enum; diff --git a/src/lib/engine.c b/src/lib/engine.c index 892169d0..c4a607fa 100644 --- a/src/lib/engine.c +++ b/src/lib/engine.c @@ -141,9 +141,9 @@ ANN static m_bool import_core_libs(const Gwi gwi) { /*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")) diff --git a/src/lib/lib_func.c b/src/lib/lib_func.c index 33e91e5e..d4c29a92 100644 --- a/src/lib/lib_func.c +++ b/src/lib/lib_func.c @@ -36,7 +36,7 @@ ANN static inline Exp cpy_nonext(const Env env, const Exp e) { 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; @@ -66,11 +66,11 @@ ANN static Exp order_curry(const Env env, Exp fn, const Exp _arg) { 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; @@ -723,8 +723,8 @@ GWION_IMPORT(func) { 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)) diff --git a/src/parse/check.c b/src/parse/check.c index 53987aee..da3a0a45 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -934,7 +934,7 @@ ANN static m_bool predefined_call(const Env env, const Type t, 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; @@ -964,8 +964,8 @@ ANN static Type check_exp_call_tmpl(const Env env, Exp_Call *exp, const Type t) } 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;