if (subscripts.length != 1) {
throw new UnsupportedSubscriptArity(getType(), subscripts.length, ctx.getCurrentAST());
}
Result<IValue> key = (Result<IValue>) subscripts[0];
if (!key.getType().isInteger()) {
throw new UnexpectedType(TypeFactory.getInstance().integerType(), key.getType(), ctx.getCurrentAST());
}
if (getValue().length() == 0) {
throw RuntimeExceptionFactory.emptyList(ctx.getCurrentAST(), ctx.getStackTrace());
}
IInteger index = ((IInteger)key.getValue());