Edits to sections 'Open arrays' and 'varargs'. (#20140)

This commit is contained in:
random-bites 2022-08-02 22:44:14 -08:00 • committed by GitHub
commit 02cbd7dc53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1535,7 +1535,7 @@ 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 type does not matter. In addition to arrays, sequences can also be passed
to an open array parameter. to an open array parameter.
The openarray type cannot be nested: multidimensional openarrays are not The `openarray` type cannot be nested: multidimensional open arrays are not
supported because this is seldom needed and cannot be done efficiently. supported because this is seldom needed and cannot be done efficiently.
```nim ```nim
@ -1549,7 +1549,7 @@ Varargs
------- -------
A `varargs` parameter is an open array parameter that additionally A `varargs` parameter is an open array parameter that additionally
allows to pass a variable number of arguments to a procedure. The compiler allows a variable number of arguments to be passed to a procedure. The compiler
converts the list of arguments to an array implicitly: converts the list of arguments to an array implicitly:
```nim ```nim
@ -1563,7 +1563,7 @@ converts the list of arguments to an array implicitly:
myWriteln(stdout, ["abc", "def", "xyz"]) myWriteln(stdout, ["abc", "def", "xyz"])
``` ```
This transformation is only done if the varargs parameter is the This transformation is only done if the `varargs` parameter is the
last parameter in the procedure header. It is also possible to perform last parameter in the procedure header. It is also possible to perform
type conversions in this context: type conversions in this context: