miller/docs
John Kerl ad252c1b2d
Document that NF is dynamic within a record (#2192) (#2193)
NF is re-evaluated at each reference, tracking the current field count
of the record as it is modified -- it is not constant per record. This
surprised a user whose C-style for-loop testing i <= NF, with a body
that added fields, became an infinite loop; the docs sentence "their
values ... change from one record to the next" implied per-record
constancy.

Changes:
- reference-dsl-variables.md.in: add an explicit paragraph and live
  example showing NF changing mid-expression as fields are added and
  removed, plus a caution about for-loops bounded by NF whose bodies
  add fields, with the two idiomatic alternatives (snapshot NF first,
  or a key-value for-loop over $* which iterates over a copy).
- reference-dsl-control-structures.md.in: note in the while/do-while
  section that those examples rely on NF's dynamism, and add a
  triple-for note warning about non-terminating NF-bounded loops.
- glossary.md.in: note dynamism in the NF entry.
- pkg/dsl/cst/keyword_usage.go: extend 'mlr help keyword NF' text
  (flows into the manpage and the usage-keywords docs section).
- Also fix a pre-existing typo nearby: "if a field has 5 records" ->
  "if a record has 5 fields".
- Regenerated docs and man pages.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 17:23:50 -04:00
..
overrides merge 2021-11-22 22:43:15 -05:00
src Document that NF is dynamic within a record (#2192) (#2193) 2026-07-14 17:23:50 -04:00
_config.yml Set theme jekyll-theme-leap-day 2021-11-05 09:41:44 -04:00
build-epub.sh Publish an epub of the docs on Read the Docs (#1835) (#2166) 2026-07-07 14:55:36 -04:00
Makefile Publish an epub of the docs on Read the Docs (#1835) (#2166) 2026-07-07 14:55:36 -04:00
mkdocs.yml More AI skill/MCP docs (#2140) 2026-07-04 14:45:29 -04:00
README.md Page-refactor for CSV/JSON troubleshooting (#2128) 2026-07-03 10:19:09 -04:00
regen.sh Remove Miller-5 source/doc/manpage directories, along with C-build files (#731) 2021-11-04 00:45:44 -04:00
requirements.txt trying https://github.com/squidfunk/mkdocs-material/issues/43 2021-11-04 19:05:15 -04:00
retitle Remove Miller-5 source/doc/manpage directories, along with C-build files (#731) 2021-11-04 00:45:44 -04:00