Skip to content

AGGREGATE: a period after a function name counts user-missing values; every function against R - #454

Merged
TonisOrmisson merged 1 commit into
mainfrom
dm-agg
Nov 26, 2026
Merged

TonisOrmisson merged 1 commit into
mainfrom
dm-agg

Conversation

@TonisOrmisson

Copy link
Copy Markdown
Contributor

The guide lets a period after a function name count user-missing values as valid (SUM.(x), PGT.(x, 30), FIRST.(x), N.(x), NMISS.(x)); Statscraft refused every such call as an unexpected character, because a name cannot end in a period. Found by an R audit of every AGGREGATE function. Fixed in AGGREGATE only: the lexer keeps the period with the name of an aggregate function when ( or a slash follows (a period that ends the line still ends the command, in AGGREGATE and everywhere else; a period in another command or after a variable is still an error), the parser records include_missing, the engine counts user-missing values as valid for that aggregation (N.(x) valid or user-missing, NMISS.(x) system-missing only, FIRST. and LAST. may take a user-missing value, whose status the target keeps). Help text, generated docs and CHANGELOG updated.

Tests: every function of the guide against R on 48 invented cases in six groups (one all missing, one a single case, the code -9 user-missing), in six runs: as is, weighted, with the period, weighted with the period, MISSING=COLUMNWISE, weighted columnwise with the period; bounds written the wrong way round and equal bounds; strings in character order; wrong-way and period parser tests. Everything else agrees with R; a count function of a group with no valid case is 0 (kept). Whole engine and syntax suites, clippy, overlap check pass. Review: medium (the low level skips test files), three rounds on the worktree; round one: the lexer change applied to every command (now AGGREGATE only, and only after a function name), whitespace forms, a docs line break; rounds two and three: nits (blank before the parenthesis allowed, NUMISS and picked values documented).

@TonisOrmisson
TonisOrmisson merged commit 82778cd into main Nov 26, 2026
3 checks passed
@TonisOrmisson
TonisOrmisson deleted the dm-agg branch November 26, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant