@Test public void testReturnThirdArgWhenFirstTwoEqual() throws Exception { List<Symbol> args = Symbols.asList(syms, "a", "a", "b", "c"); assertSame(args.get(2), new IfEq().execute(rhsFuncContext, args)); }
@Override public Symbol execute(RhsFunctionContext rhsContext, List<Symbol> arguments) throws RhsFunctionException { RhsFunctions.checkArgumentCount(this, arguments); return arguments.get(0) == arguments.get(1) ? arguments.get(2) : arguments.get(3); }
IfEq extends AbstractRhsFunctionHandler { @Override public Symbol execute(RhsFunctionContext rhsContext, List<Symbol> arguments) throws RhsFunctionException { RhsFunctions.checkArgumentCount(this, arguments); return arguments.get(0) == arguments.get(1) ? arguments.get(2) : arguments.get(3); } }
IfEq extends AbstractRhsFunctionHandler { @Override public Symbol execute(RhsFunctionContext rhsContext, List<Symbol> arguments) throws RhsFunctionException { RhsFunctions.checkArgumentCount(this, arguments); return arguments.get(0) == arguments.get(1) ? arguments.get(2) : arguments.get(3); } IfEq(); }
IfEq extends AbstractRhsFunctionHandler { @Override public Symbol execute(RhsFunctionContext rhsContext, List<Symbol> arguments) throws RhsFunctionException { RhsFunctions.checkArgumentCount(this, arguments); return arguments.get(0) == arguments.get(1) ? arguments.get(2) : arguments.get(3); } IfEq(); @Override Symbol execute(RhsFunctionContext rhsContext, List<Symbol> arguments); }
IfEq extends AbstractRhsFunctionHandler { @Override public Symbol execute(RhsFunctionContext rhsContext, List<Symbol> arguments) throws RhsFunctionException { RhsFunctions.checkArgumentCount(this, arguments); return arguments.get(0) == arguments.get(1) ? arguments.get(2) : arguments.get(3); } IfEq(); @Override Symbol execute(RhsFunctionContext rhsContext, List<Symbol> arguments);  }