@Override
	public Value evaluate(Context context)
	{
		Value operand1 = get(0, context);
		Value operand2 = get(1, context);
		if (operand1.isNumber() && operand2.isList())
		{
			BigDecimal value1 = operand1.getNumber();
			List<Value> value2 = operand2.getList();
			return value2.get(value1.intValue());
		}
		else if (operand1.isNumber() && operand2.isString())
		{
			BigDecimal value1 = operand1.getNumber();
			String value2 = operand2.getString();
			return Value.asString(String.valueOf(value2.charAt(value1.intValue())));
		}
		// TODO: explain more
		throw new RuntimeException("Cannot perform operation '" + token.lexeme + "' at: [" + token.line + ", " + token.column + "]");
	}
@Override
	public Value evaluate(Context context)
	{
		Value operand1 = get(0, context);
		Value operand2 = get(1, context);
		if (operand1.isNumber() && operand2.isList())
		{
			BigDecimal value1 = operand1.getNumber();
			List<Value> value2 = operand2.getList();
			return value2.get(value1.intValue());
		}
		else if (operand1.isNumber() && operand2.isString())
		{
			BigDecimal value1 = operand1.getNumber();
			String value2 = operand2.getString();
			return Value.asString(String.valueOf(value2.charAt(value1.intValue())));
		}
	
		throw new RuntimeException("Cannot perform operation '" + token.lexeme + "' at: [" + token.line + ", " + token.column + "]");
	}
@override public value evaluate(context context) { value operand1 = get(0, context); value operand2 = get(1, context); if (operand1.isnumber() && operand2.islist()) { bigdecimal value1 = operand1.getnumber(); list<value> value2 = operand2.getlist(); return value2.get(value1.intvalue()); } else if (operand1.isnumber() && operand2.isstring()) { bigdecimal value1 = operand1.getnumber(); string value2 = operand2.getstring(); return value.asstring(string.valueof(value2.charat(value1.intvalue()))); } throw new runtimeexception("cannot perform operation '" + token.lexeme + "' at: [" + token.line + ", " + token.column + "]"); }