Update seqs.md

This commit is contained in:
Flaviu Tamas 2014-11-30 16:50:31 -05:00
commit 19183151c6

View file

@ -4,7 +4,7 @@ title: Seqs
# Seqs # Seqs
Seqs provide dynamically expandable storage, they are extended as needed. Seqs, abbreviated from "sequence", provide dynamically expandable storage.
There are two ways to create seqs, with the `@` operator and with the `newSeq[T](n: int)` method. Once a seq is created, it can be modified using the `add(item: T)`, `delete(idx: int)`. The length of a seq can be found through `len: int`, and the maximum index through `high: int`. The standard `items: T` and `pairs: tuple[i: int, v: T]` iterators are also available. There are two ways to create seqs, with the `@` operator and with the `newSeq[T](n: int)` method. Once a seq is created, it can be modified using the `add(item: T)`, `delete(idx: int)`. The length of a seq can be found through `len: int`, and the maximum index through `high: int`. The standard `items: T` and `pairs: tuple[i: int, v: T]` iterators are also available.
@ -50,4 +50,4 @@ var thisSeq = newSeq[int](10)
foo(thisSeq) foo(thisSeq)
assert thisSeq[9] == 999 assert thisSeq[9] == 999
``` ```