public <U extends IValue, V extends IValue> Result<U> subscript(Result<?>[] subscripts) {
if (subscripts.length != 1) {
throw new UnsupportedSubscriptArity(getType(), subscripts.length, ctx.getCurrentAST());
}
if (!((Result<IValue>)subscripts[0]).getType().isInteger()) {
throw new UnexpectedType(getTypeFactory().integerType(),
((Result<IValue>)subscripts[0]).getType(), ctx.getCurrentAST());
}
IInteger index = ((IntegerResult)subscripts[0]).getValue();
int idx = index.intValue();
if (idx < 0){