From 2a470c4217e0ee7d002afd7910e875e4079edc08 Mon Sep 17 00:00:00 2001 From: flaviut Date: Tue, 8 Apr 2014 17:56:11 -0400 Subject: [PATCH] Document inplace string appending --- lib/system.nim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/system.nim b/lib/system.nim index 7b6f9716be..6de9f3a8a5 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -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.