Skip to content

Use of counter variable #19

@svarnypetr

Description

@svarnypetr

If we also need to have an iteration counter (starting from zero), we can achieve that by using for , in : syntax. This is very practical if you want to iterate through one iterable, and simultaneously access another iterable at the same offset.

However, as far as I know, this works only with strings, it does not work for iterators in general (for example countTo fails). However, it does work on containers. At least in my Nim 1.4.0.

So I suggest changing the text to:

If we also need to have an iteration counter (starting from zero), we can achieve that by using for , in : syntax. This is very practical if you want to iterate through one container, and simultaneously access another container at the same offset. Containers are explained just a little bit later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions