Remove double punctuation. Change "contrained" wording to "constraint".
This commit is contained in:
parent
f6c12853ea
commit
910dce70d6
2 changed files with 4 additions and 3 deletions
|
|
@ -539,7 +539,7 @@ Closure iterators have other restrictions than inline iterators:
|
||||||
1. ``yield`` in a closure iterator can not occur in a ``try`` statement.
|
1. ``yield`` in a closure iterator can not occur in a ``try`` statement.
|
||||||
2. For now, a closure iterator cannot be evaluated at compile time.
|
2. For now, a closure iterator cannot be evaluated at compile time.
|
||||||
3. ``return`` is allowed in a closure iterator (but rarely useful) and ends
|
3. ``return`` is allowed in a closure iterator (but rarely useful) and ends
|
||||||
iteration..
|
iteration.
|
||||||
4. Neither inline nor closure iterators can be recursive.
|
4. Neither inline nor closure iterators can be recursive.
|
||||||
|
|
||||||
Iterators that are neither marked ``{.closure.}`` nor ``{.inline.}`` explicitly
|
Iterators that are neither marked ``{.closure.}`` nor ``{.inline.}`` explicitly
|
||||||
|
|
|
||||||
|
|
@ -43,8 +43,9 @@ Fortunately Nim supports side effect analysis:
|
||||||
|
|
||||||
echo f() * 2 # not optimized ;-)
|
echo f() * 2 # not optimized ;-)
|
||||||
|
|
||||||
You can make one overload for constrained match and without, and the constrained
|
You can make one overload matching with a constraint and one without, and the
|
||||||
will be prioritized, and so you can handle both cases differently.
|
one with a constraint will have precedence, and so you can handle both cases
|
||||||
|
differently.
|
||||||
|
|
||||||
So what about ``2 * a``? We should tell the compiler ``*`` is commutative. We
|
So what about ``2 * a``? We should tell the compiler ``*`` is commutative. We
|
||||||
cannot really do that however as the following code only swaps arguments
|
cannot really do that however as the following code only swaps arguments
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue