documentation improvements
This commit is contained in:
parent
73553308f8
commit
88f9eff38f
2 changed files with 6 additions and 3 deletions
|
|
@ -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:
|
variadic proc, it is implicitely converted to ``cstring`` too:
|
||||||
|
|
||||||
.. code-block:: nimrod
|
.. 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")
|
printf("This works %s", "as expected")
|
||||||
|
|
||||||
|
|
@ -2054,6 +2055,7 @@ Type casts
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
|
|
||||||
.. code-block:: nimrod
|
.. code-block:: nimrod
|
||||||
cast[int](x)
|
cast[int](x)
|
||||||
|
|
||||||
|
|
@ -2555,6 +2557,7 @@ type class matches
|
||||||
================== ===================================================
|
================== ===================================================
|
||||||
``object`` any object type
|
``object`` any object type
|
||||||
``tuple`` any tuple type
|
``tuple`` any tuple type
|
||||||
|
|
||||||
``enum`` any enumeration
|
``enum`` any enumeration
|
||||||
``proc`` any proc type
|
``proc`` any proc type
|
||||||
``ref`` any ``ref`` 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:
|
a `thead-local`:idx: variable then:
|
||||||
|
|
||||||
.. code-block:: nimrod
|
.. code-block:: nimrod
|
||||||
var checkpoints* {.thread.}: seq[string] = @[]
|
var checkpoints* {.threadvar.}: seq[string] = @[]
|
||||||
|
|
||||||
|
|
||||||
Actor model
|
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 ``&``
|
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
|
Strings are compared by their lexicographical order. All comparison operators
|
||||||
are available. Per convention, all strings are UTF-8 strings, but this is not
|
are available. Per convention, all strings are UTF-8 strings, but this is not
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue