> Er, you can slice with toOpenArray, no need for the inRange: var stuff.
That isn't enough, because the proc alters the range (that's why `inRange` is a
`var`.) It's basically consuming part of the input array, and updates the start
of the range so that on return it points to only the unconsume
> I'm writing code that manipulates portions of seq s, and I keep creating proc
> parameter lists that include input: openarray[byte]; inRange: var Slice[int],
> and then inside the proc I keep writing stuff like input[inRange.a + i]
Er, you can slice with `toOpenArray`, no need for the `inRange
> There is also openArray. It's currently restricted to parameters due to
> memory safety reasons, there is an RFC to extend it.
I assume you mean [this](https://github.com/nim-lang/RFCs/issues/178)? What's
the status of that and the other
[Nim2020](https://github.com/nim-lang/RFCs/milestone/1)
I'm writing code that manipulates portions of `seq``s, and I keep creating proc
parameter lists that include ``input: openarray[byte]; inRange: var
Slice[int]`, and then inside the proc I keep writing stuff like
`input[inRange.a + i]` 😝
I have a large C++ codebase that uses a custom `slice` typ
There is also `openArray`. It's currently restricted to parameters due to
memory safety reasons, there is an RFC to extend it. I personally mostly use
integer indexing which is easier to prove correct than non-owning views. Much
easier.
As I get more fluent in Nim, the main tool I find myself missing is a
lightweight reference to a range of bytes in memory — something that points to
a portion of a `seq` without copying it. The closest equivalent I know of is
Go's `slice[T]`, which is pretty ubiquitous — it's actually rare in Go