diff --git a/doc/manual.rst b/doc/manual.rst index 13d5cda61eaf3..0f82088ce0ad6 100644 --- a/doc/manual.rst +++ b/doc/manual.rst @@ -2644,6 +2644,25 @@ Varargs matching See `Varargs <#types-varargs>`_. +iterable +-------- + +A called `iterator` yielding type `T` can be passed to a template or macro via +a parameter typed as `untyped` (for unresolved expressions) or the type class +`iterable` or `iterable[T]` (after type checking and overload resolution). + +.. code-block:: nim + iterator iota(n: int): int = + for i in 0..`_ for passing iterators to templates and macros. + Converters ========== @@ -5601,9 +5623,7 @@ Another common example is this: var info = something().toSeq -The problem here is that the compiler already decided that `something()` as -an iterator is not callable in this context before `toSeq` gets its -chance to convert it into a sequence. +This will be fixed by using the `iterable <#overloading-resolution-iterable>`_ type class in `toSeq` implementation. It is also not possible to use fully qualified identifiers with module symbol in method call syntax. The order in which the dot operator