diff options
| author | Tyge Løvset <[email protected]> | 2022-09-26 12:58:18 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-09-26 12:58:18 +0200 |
| commit | 2e3db1c709e88d68cece8c46566ca6b8481b7c07 (patch) | |
| tree | 1f0a729f9918e0ed05a370fc56ae4b84a8ca53a7 /docs/ccommon_api.md | |
| parent | b49dd3163d699852450cf18c27f012c98a0fc2f8 (diff) | |
| download | STC-modified-2e3db1c709e88d68cece8c46566ca6b8481b7c07.tar.gz STC-modified-2e3db1c709e88d68cece8c46566ca6b8481b7c07.zip | |
Added c_flt_takewhile() filter to c_forfilter() macro.
Diffstat (limited to 'docs/ccommon_api.md')
| -rw-r--r-- | docs/ccommon_api.md | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/docs/ccommon_api.md b/docs/ccommon_api.md index 70033445..1b364e58 100644 --- a/docs/ccommon_api.md +++ b/docs/ccommon_api.md @@ -216,19 +216,20 @@ c_forloop (i, 30, 0, -5) printf(" %lld", i); ### c_forwhile, c_forfilter Iterate containers with stop-criteria and chained range filtering. -| Usage | Description | -|:-----------------------------------------------------------|:-------------------------------------| -| `c_forwhile (it, ctype, container, whilepred)` | Iterate as long as whilepred is true | -| `c_forfilter (it, ctype, container, filter(s))` | Filter out items in chain | -| `c_forfilter (it, ctype, container, filter(s), whilepred)` | Adds a "takewhile" filter argument | +| Usage | Description | +|:--------------------------------------------------------------|:-------------------------------------| +| `c_forwhile (it, ctype, container, shortcircuit)` | Iterate until shortcircuit is false | +| `c_forfilter (it, ctype, container, filter(s))` | Filter out items in chain | +| `c_forfilter (it, ctype, container, filter(s), shortcircuit)` | Add a "short-circuit" pred/filter | | Built-in filter | Description | |:----------------------------------|:-------------------------------------| | `c_flt_drop(it, numItems)` | Drop numItems | -| `c_flt_dropwhile(it, predicate)` | Drop items until predicate is false | | `c_flt_take(it, numItems)` | Take numItems | +| `c_flt_dropwhile(it, predicate)` | Drop items until predicate is false | +| `c_flt_takewhile(it, predicate)` | Take items until predicate is false | -`it.index` holds the current item index. +`it.index` holds the index of the source item. ```c #define i_type IVec #define i_val int |
