forked from lix-project/lix
Remove PrimOp constructor
This commit is contained in:
parent
dc2f278c95
commit
25ecfffdc3
2 changed files with 2 additions and 4 deletions
|
@ -509,7 +509,7 @@ Value * EvalState::addPrimOp(const string & name,
|
||||||
if (arity == 0) {
|
if (arity == 0) {
|
||||||
auto vPrimOp = allocValue();
|
auto vPrimOp = allocValue();
|
||||||
vPrimOp->type = tPrimOp;
|
vPrimOp->type = tPrimOp;
|
||||||
vPrimOp->primOp = new PrimOp(primOp, 1, sym);
|
vPrimOp->primOp = new PrimOp { .fun = primOp, .arity = 1, .name = sym };
|
||||||
Value v;
|
Value v;
|
||||||
mkApp(v, *vPrimOp, *vPrimOp);
|
mkApp(v, *vPrimOp, *vPrimOp);
|
||||||
return addConstant(name, v);
|
return addConstant(name, v);
|
||||||
|
@ -517,7 +517,7 @@ Value * EvalState::addPrimOp(const string & name,
|
||||||
|
|
||||||
Value * v = allocValue();
|
Value * v = allocValue();
|
||||||
v->type = tPrimOp;
|
v->type = tPrimOp;
|
||||||
v->primOp = new PrimOp(primOp, arity, sym);
|
v->primOp = new PrimOp { .fun = primOp, .arity = arity, .name = sym };
|
||||||
staticBaseEnv.vars[symbols.create(name)] = baseEnvDispl;
|
staticBaseEnv.vars[symbols.create(name)] = baseEnvDispl;
|
||||||
baseEnv.values[baseEnvDispl++] = v;
|
baseEnv.values[baseEnvDispl++] = v;
|
||||||
baseEnv.values[0]->attrs->push_back(Attr(sym, v));
|
baseEnv.values[0]->attrs->push_back(Attr(sym, v));
|
||||||
|
|
|
@ -30,8 +30,6 @@ struct PrimOp
|
||||||
PrimOpFun fun;
|
PrimOpFun fun;
|
||||||
size_t arity;
|
size_t arity;
|
||||||
Symbol name;
|
Symbol name;
|
||||||
PrimOp(PrimOpFun fun, size_t arity, Symbol name)
|
|
||||||
: fun(fun), arity(arity), name(name) { }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue