minor documentation updates

This commit is contained in:
Araq
2015-02-16 02:56:40 +01:00
parent 442dc30922
commit eaf00dd1fb
4 changed files with 115 additions and 3 deletions

View File

@@ -569,7 +569,7 @@ language for object types:
type
StdMap {.importcpp: "std::map", header: "<map>".} [K, V] = object
proc `[]=`[K, V](this: var StdMap[K, V]; key: K; val: V) {.
importcpp: "#[#] = #".}
importcpp: "#[#] = #", header: "<map>".}
var x: StdMap[cint, cdouble]
x[6] = 91.4

View File

@@ -749,7 +749,8 @@ Forward declarations
--------------------
Every variable, procedure, etc. needs to be declared before it can be used.
(The reason for this is compilation efficiency.)
(The reason for this is that it is non-trivial to do better than that in a
language that supports meta programming as extensively as Nim does.)
However, this cannot be done for mutually recursive procedures:
.. code-block:: nim
@@ -767,7 +768,7 @@ introduced to the compiler before it is completely defined. The syntax for
such a forward declaration is simple: just omit the ``=`` and the
procedure's body.
Later versions of the language may get rid of the need for forward
Later versions of the language will weaken the requirements for forward
declarations.
The example also shows that a proc's body can consist of a single expression