factoriolib / flib

A set of high-quality, commonly-used utilities for creating Factorio mods.
https://mods.factorio.com/mod/flib
MIT License
61 stars 15 forks source link

table.for_n_of behavior clarification #63

Closed blargh2015 closed 4 months ago

blargh2015 commented 5 months ago

Description

The docs could use a clarification for table.for_n_of in the following cases:

The answers to both are manageable in the calling code, but would be nice to have answers as to what's intended in the docs. Glancing at the docs it LOOKS like the answers to both could be handled by clarifying:

"Calls callback(value, key) over n items from tbl, starting after from_k."

to

"Calls callback(value, key) over n items (or until the end of the table is reached) from tbl, starting after from_k."

Reproduction

No response