From dabe4aed8663db0b2e242df1d2945fd9dd6abee0 Mon Sep 17 00:00:00 2001 From: jlp765 Date: Thu, 21 Sep 2017 17:48:49 +1000 Subject: [PATCH] documentation improvement; make mixin easier to search (#6409) --- doc/manual/generics.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/manual/generics.txt b/doc/manual/generics.txt index 87fcb78285..cceea33c0d 100644 --- a/doc/manual/generics.txt +++ b/doc/manual/generics.txt @@ -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