system: some documentation improvements (#10809)

This commit is contained in:
Miran 2019-03-11 11:04:08 +01:00 • committed by GitHub
commit 06f23572d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 1412 additions and 820 deletions

View file

@ -41,6 +41,13 @@ proc hashString(s: string): int {.compilerproc.} =
result = h
proc add*(result: var string; x: int64) =
## Converts integer to its string representation and appends it to `result`.
##
## .. code-block:: Nim
## var
## a = "123"
## b = 45
## a.add(b) # a <- "12345"
let base = result.len
setLen(result, base + sizeof(x)*4)
var i = 0
@ -64,6 +71,13 @@ proc nimIntToStr(x: int): string {.compilerRtl.} =
result.add x
proc add*(result: var string; x: float) =
## Converts float to its string representation and appends it to `result`.
##
## .. code-block:: Nim
## var
## a = "123"
## b = 45.67
## a.add(b) # a <- "12345.67"
when nimvm:
result.add $x
else: