mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-22 08:51:21 +00:00
Suggested small change to code (#5509)
In a code example I think it best to either use full names (index, item) or abbreviated names where that's common (i, item) but not non-standard abbreviations (indx, itm). So I've changed it to index, item since it is a tutorial, although i, item would be just as good.
This commit is contained in:
committed by
Andreas Rumpf
parent
1be0022e7c
commit
3ab884a9e3
@@ -411,8 +411,8 @@ Other useful iterators for collections (like arrays and sequences) are
|
||||
* ``pairs`` and ``mpairs`` which provides the element and an index number (immutable and mutable respectively)
|
||||
|
||||
.. code-block:: nim
|
||||
for indx, itm in ["a","b"].pairs:
|
||||
echo itm, " at index ", indx
|
||||
for index, item in ["a","b"].pairs:
|
||||
echo item, " at index ", index
|
||||
# => a at index 0
|
||||
# => b at index 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user