Document inplace string appending

This commit is contained in:
flaviut
2014-04-08 17:56:11 -04:00
parent 6e70d8afb4
commit 2a470c4217

View File

@@ -869,7 +869,21 @@ proc `&` * (x: char, y: string): string {.
# that the merge optimization works properly.
proc add*(x: var string, y: char) {.magic: "AppendStrCh", noSideEffect.}
## Appends `y` to `x` in place
##
## .. code-block:: Nimrod
## var tmp = ""
## tmp.add('a')
## tmp.add('b')
## assert(tmp == "ab")
proc add*(x: var string, y: string) {.magic: "AppendStrStr", noSideEffect.}
## Concatinates `x` and `y` in place
##
## .. code-block:: Nimrod
## var tmp = ""
## tmp.add("ab")
## tmp.add("cd")
## assert(tmp == "abcd")
type
TEndian* = enum ## is a type describing the endianness of a processor.