diff options
| author | eunhhu <[email protected]> | 2026-09-26 11:23:07 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-09-26 11:23:07 +0100 |
| commit | db28e3401e5a137845fdb1661e1af6297477b0c8 (patch) | |
| tree | c398c82bc115002c1a315ca1713e06a7102fd5ab /docs/design/001-language-v0.md | |
| parent | acbd39e3e838fe49b17e32fe254af9ea12b4f81b (diff) | |
| download | aup-db28e3401e5a137845fdb1661e1af6297477b0c8.tar.gz aup-db28e3401e5a137845fdb1661e1af6297477b0c8.zip | |
Add count, sum, max and min over a list
count(t in tasks where !t.done), sum(t.points for t in tasks), and max
and min in the same form compile to Pure's FOLD: the value and the where
condition become a block run once per item, as a column of the list, so
views count and add without a copy of the list or a state kept in step.
max(a, b), min(a, b) and fns of the same names stay calls, told apart by
the `for` after the first expression or the `name in` after count(.
Inside the block only its item and states can be read; a parameter of
the fn outside, the enclosing column's row, dt and a fold inside a fold
are compile errors that say why. The checks run 3,600 random steps
against a Python model and add seven diagnostics.
Diffstat (limited to 'docs/design/001-language-v0.md')
0 files changed, 0 insertions, 0 deletions
