public <U extends IValue, V extends IValue> Result<U> slice(Result<?> first, Result<?> second, Result<?> end) {
return super.slice(first, second, end, getValue().arity());
}
public Result<IValue> makeSlice(int first, int second, int end){
IListWriter w = getValueFactory().listWriter();
int increment = second - first;
if(first == end || increment == 0){
// nothing to be done
} else
if(first <= end){
for(int i = first; i >= 0 && i < end; i += increment){
w.append(getValue().get(i));
}
} else {
for(int j = first; j >= 0 && j > end && j < getValue().arity(); j += increment){
w.append(getValue().get(j));
}
}
TypeFactory tf = TypeFactory.getInstance();
return makeResult(tf.listType(tf.valueType()), w.done(), ctx);
}