Merge branch 'devel' into araq
This commit is contained in:
commit
e9243a1616
152 changed files with 3012 additions and 3097 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue