1
0
mirror of https://github.com/DanilaFe/abacus synced 2026-01-11 17:45:20 +00:00

Implement unary operators.

This commit is contained in:
2017-07-28 11:14:45 -07:00
parent 42393ca6a6
commit 5228773b5e
5 changed files with 80 additions and 6 deletions

View File

@@ -89,7 +89,7 @@ public class StandardPlugin extends Plugin {
}
}));
registerFunction("!", new Function() {
registerOperator("!", new Operator(OperatorAssociativity.RIGHT, OperatorType.UNARY_POSTFIX, 0, new Function() {
//private HashMap<Class<? extends NumberInterface>, ArrayList<NumberInterface>> storedList = new HashMap<Class<? extends NumberInterface>, ArrayList<NumberInterface>>();
@Override
protected boolean matchesParams(NumberInterface[] params) {
@@ -114,7 +114,7 @@ public class StandardPlugin extends Plugin {
storedList.get(params[0].getClass()).add(NaiveNumber.ONE.promoteTo(params[0].getClass()));
}*/
}
});
}));
registerFunction("abs", new Function() {
@Override