> Rather what is the difference between openArray and seq? This is explained clearly in the manual (emphasis added):
"Often fixed size arrays turn out to be too inflexible; procedures should be able to deal with arrays of different sizes. The openarray type allows this; it can only be used for parameters. Openarrays are always indexed with an int starting at position 0. The len, low and high operations are available for open arrays too. Any array with a compatible base type can be passed to an openarray parameter, the index type does not matter. **In addition to arrays sequences can also be passed to an open array parameter**." > Isn't openArray redundant? With what? You can't replace an openArray parameter with `array`, which isn't compatible with `seq`. And you can't replace it with `seq`, which isn't compatible with arrays. > First of all openArray is compatible with array and seq isn't. > > But I can very well use ... array ... can't I? If yes, then openArray seems > redundant. Um, so you took Araq's statement to mean that openArray is compatible with array but _not_ to mean that it is also compatible with seq? Or do you plan to always write separate procs to handle array and seq arguments? The idea that openArray (which can only occur as a parameter) is compatible with both (one-dimensional) arrays and seqs is a very simple one. Stop fighting it. > A more descriptive name like "contiguous_slice" or even "ptr_and_len" Ugh. These are terrible names. There are already slices in Nim, and what would a non-contiguous slice be? And ptr_and_len is implementation-on-the-brain ... it's the wrong descriptive level. And what language are you writing in? The names you want are continguousSlice and ptrAndLen. > would be answer most openArray questions directly They really wouldn't.
