Merge branch 'devel' into araq

This commit is contained in:
Andreas Rumpf 2017-10-02 08:31:38 +02:00
commit e9243a1616
152 changed files with 3012 additions and 3097 deletions

View file

@ -16,6 +16,6 @@ shl shr static
template try tuple type
using
var
when while with without
when while
xor
yield

View file

@ -633,6 +633,9 @@ the ``vtptr`` magic produced types bound to ``ptr`` types.
Symbol lookup in generics
-------------------------
Open and Closed symbols
~~~~~~~~~~~~~~~~~~~~~~~
The symbol binding rules in generics are slightly subtle: There are "open" and
"closed" symbols. A "closed" symbol cannot be re-bound in the instantiation
context, an "open" symbol can. Per default overloaded symbols are open
@ -658,6 +661,9 @@ the ``Index`` type is defined *after* the ``==`` for tuples; yet the example
compiles as the instantiation takes the currently defined symbols into account
too.
Mixin statement
---------------
A symbol can be forced to be open by a `mixin`:idx: declaration:
.. code-block:: nim

View file

@ -547,9 +547,6 @@ Instead of:
Using statement
---------------
**Warning**: The ``using`` statement is experimental and has to be
explicitly enabled with the `experimental`:idx: pragma or command line option!
The using statement provides syntactic convenience in modules where
the same parameter names and types are used over and over. Instead of:
@ -563,7 +560,6 @@ name ``c`` should default to type ``Context``, ``n`` should default to
``Node`` etc.:
.. code-block:: nim
{.experimental.}
using
c: Context
n: Node

View file

@ -550,8 +550,7 @@ order. The *names* of the fields also have to be identical.
The assignment operator for tuples copies each component.
The default assignment operator for objects copies each component. Overloading
of the assignment operator for objects is not possible, but this will change
in future versions of the compiler.
of the assignment operator is described in `type-bound-operations-operator`_.
.. code-block:: nim

View file

@ -185,9 +185,8 @@ to a storage location:
var x = "abc" # introduces a new variable `x` and assigns a value to it
x = "xyz" # assigns a new value to `x`
``=`` is the *assignment operator*. The assignment operator cannot be
overloaded, overwritten or forbidden, but this might change in a future version
of Nim. You can declare multiple variables with a single assignment
``=`` is the *assignment operator*. The assignment operator can be
overloaded. You can declare multiple variables with a single assignment
statement and all the variables will have the same value:
.. code-block::