documentation improvements

This commit is contained in:
Araq
2012-02-13 00:23:11 +01:00
parent 73553308f8
commit 88f9eff38f
2 changed files with 6 additions and 3 deletions

View File

@@ -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

View File

@@ -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