-
Notifications
You must be signed in to change notification settings - Fork 97
Open
Milestone
Description
It might be good to refactor the procs so that rather than conditioning on types inside e.g. doBinOpvv, there's a where in the function signature that brings calls directly to the correct proc implementing that case. Furthermore, there's a lot of overlap between the actual operator handing; could there just be a few procs that do something like
select op {
when Mul { e = (l.a: etype * r.a: etype): etype; }
when Add { e = (l.a: etype + r.a: etype): etype; }
when Sub { e = (l.a: etype - r.a: etype): etype; }
when Div { e = (l.a: etype / r.a: etype): etype; }
when Mod {
ref ea = e;
ref la = l.a;
ref ra = r.a;
[(ei,li,ri) in zip(ea,la,ra)] ei = modHelper(li: etype, ri: etype): etype;
}
when FloorDiv {
ref ea = e;
ref la = l.a;
ref ra = r.a;
ea = floorDivision(la, ra, etype);
}
when Pow {
e = ((l.a: etype) ** (r.a: etype)): etype;
}
otherwise do return MsgTuple.error(nie);
}and handle this for multiple functions?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels