mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-06 13:07:48 +00:00
documentation improvements
This commit is contained in:
@@ -730,7 +730,8 @@ to ``cstring`` for convenience. If a Nimrod string is passed to a C-style
|
||||
variadic proc, it is implicitely converted to ``cstring`` too:
|
||||
|
||||
.. code-block:: nimrod
|
||||
proc printf(formatstr: cstring) {.importc: "printf", varargs.}
|
||||
proc printf(formatstr: cstring) {.importc: "printf", varargs,
|
||||
header: "<stdio.h>".}
|
||||
|
||||
printf("This works %s", "as expected")
|
||||
|
||||
@@ -2054,6 +2055,7 @@ Type casts
|
||||
~~~~~~~~~~
|
||||
Example:
|
||||
|
||||
|
||||
.. code-block:: nimrod
|
||||
cast[int](x)
|
||||
|
||||
@@ -2555,6 +2557,7 @@ type class matches
|
||||
================== ===================================================
|
||||
``object`` any object type
|
||||
``tuple`` any tuple type
|
||||
|
||||
``enum`` any enumeration
|
||||
``proc`` any proc type
|
||||
``ref`` any ``ref`` type
|
||||
@@ -3467,7 +3470,7 @@ A global variable can be marked with the `threadvar`:idx: pragma; it is
|
||||
a `thead-local`:idx: variable then:
|
||||
|
||||
.. code-block:: nimrod
|
||||
var checkpoints* {.thread.}: seq[string] = @[]
|
||||
var checkpoints* {.threadvar.}: seq[string] = @[]
|
||||
|
||||
|
||||
Actor model
|
||||
|
||||
@@ -831,7 +831,7 @@ terminating zero is no error and often leads to simpler code:
|
||||
...
|
||||
|
||||
The assignment operator for strings copies the string. You can use the ``&``
|
||||
operator to concatenate strings.
|
||||
operator to concatenate strings and ``add`` to append to a string.
|
||||
|
||||
Strings are compared by their lexicographical order. All comparison operators
|
||||
are available. Per convention, all strings are UTF-8 strings, but this is not
|
||||
|
||||
Reference in New Issue
Block a user