func slice(ls : List+String, range : List) -> List+String return [all ls(i) for i in range] when ls in List return concat([all ls(i) for i in range])
slice(`a string value' [3..9]) = `string' slice(`a string value' [1..2, 10..14]) = `a value'
Note: This function may be too general. I have not yet had occasion to use it with more than a single range. In fact, the function currently does not behave as advertised when strings are sliced with multiple ranges. It may well be changed to accept the start and end indices of a single range as explicit parameters.