Merge pull request #684 from gradha/pr_clarifies_docs

Clarifies wording of newSeq proc docstrings.
This commit is contained in:
Andreas Rumpf 2013-11-30 16:25:44 -08:00
commit 5bf395040f

View file

@ -374,10 +374,10 @@ proc newSeq*[T](s: var seq[T], len: int) {.magic: "NewSeq", noSideEffect.}
## This is equivalent to ``s = @[]; setlen(s, len)``, but more ## This is equivalent to ``s = @[]; setlen(s, len)``, but more
## efficient since no reallocation is needed. ## efficient since no reallocation is needed.
## ##
## Note that the sequence will be filled with uninitialized entries, which ## Note that the sequence will be filled with zeroed entries, which can be a
## can be a problem for sequences containing strings. After the creation of ## problem for sequences containing strings since their value will be
## the sequence you should assign entries to the sequence instead of adding ## ``nil``. After the creation of the sequence you should assign entries to
## them. Example: ## the sequence instead of adding them. Example:
## ##
## .. code-block:: nimrod ## .. code-block:: nimrod
## var inputStrings : seq[string] ## var inputStrings : seq[string]
@ -390,10 +390,10 @@ proc newSeq*[T](s: var seq[T], len: int) {.magic: "NewSeq", noSideEffect.}
proc newSeq*[T](len = 0): seq[T] = proc newSeq*[T](len = 0): seq[T] =
## creates a new sequence of type ``seq[T]`` with length ``len``. ## creates a new sequence of type ``seq[T]`` with length ``len``.
## ##
## Note that the sequence will be filled with uninitialized entries, which ## Note that the sequence will be filled with zeroed entries, which can be a
## can be a problem for sequences containing strings. After the creation of ## problem for sequences containing strings since their value will be
## the sequence you should assign entries to the sequence instead of adding ## ``nil``. After the creation of the sequence you should assign entries to
## them. Example: ## the sequence instead of adding them. Example:
## ##
## .. code-block:: nimrod ## .. code-block:: nimrod
## var inputStrings = newSeq[string](3) ## var inputStrings = newSeq[string](3)