mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-04 20:17:42 +00:00
Merge pull request #3420 from jlp765/manual1
fix #3418 add example on openArray to types.txt
This commit is contained in:
@@ -490,6 +490,11 @@ to an open array parameter.
|
||||
The openarray type cannot be nested: multidimensional openarrays are not
|
||||
supported because this is seldom needed and cannot be done efficiently.
|
||||
|
||||
.. code-block:: nim
|
||||
proc testOpenArray(x: openArray[int]) = echo repr(x)
|
||||
|
||||
testOpenArray([1,2,3]) # array[]
|
||||
testOpenArray(@[1,2,3]) # seq[]
|
||||
|
||||
Varargs
|
||||
-------
|
||||
|
||||
Reference in New Issue
Block a user