diff --git a/c/todo.txt b/c/todo.txt index d20f65273..9def1feee 100644 --- a/c/todo.txt +++ b/c/todo.txt @@ -15,11 +15,9 @@ NON-RELEASE: ---------------------------------------------------------------- PRE-RELEASE 4.6.0: -! valgrinds -! xxxes - -!! multi-statement in continuation of triple-for !! -? substr func ? -> use @ mand +! multi-statement in continuation of triple-for !! +* valgrinds +* xxxes ---------------------------------------------------------------- DOC FOR 4.6.0: diff --git a/doc/content-for-reference.html b/doc/content-for-reference.html index ea3d686c7..e156ee3e1 100644 --- a/doc/content-for-reference.html +++ b/doc/content-for-reference.html @@ -1127,7 +1127,7 @@ POKI_RUN_COMMAND{{cat data/scope-example.dat}}HERE POKI_RUN_COMMAND{{mlr --oxtab --from data/scope-example.dat put -f data/scope-example.mlr}}HERE -

Out-of-stream variables for put

+

Out-of-stream variables

These are prefixed with an at-sign, e.g. @sum. Furthermore, unlike built-in variables and stream-record fields, they are maintained in an @@ -1159,7 +1159,7 @@ POKI_RUN_COMMAND{{mlr put '@sum += $a; end {emit @sum}' then put 'ispresent($a) etc. -

Indexed out-of-stream variables for put

+

Indexed out-of-stream variables

Using an index on the @count and @sum variables, we get the benefit of the -g (group-by) option which mlr stats1 and various other Miller commands have: @@ -1181,7 +1181,7 @@ control in what you do. POKI_INCLUDE_AND_RUN_ESCAPED(data/begin-end-example-8.sh)HERE -

Aggregate variable assignments for put

+

Aggregate variable assignments

There are three remaining kinds of variable assignment using out-of-stream variables, the last two of which use the $* syntax: @@ -1381,7 +1381,7 @@ required even if the body is a single statement, or empty. -

Begin/end blocks for put

+

Begin/end blocks

Miller supports an awk-like begin/end syntax. The statements in the begin block are executed before any input records @@ -1422,7 +1422,7 @@ names (beginning with $), since these execute outside the context of input records. -

Output statements for put

+

Output statements

xxx grist: You can output built-in variables indirectly, by assigning them to a non-built-in variable: e.g. $nr = NR adds a field named @@ -1444,7 +1444,7 @@ immediate prints to stdout/stderr. The printn and eprintn keywords are the same except that they don’t print final newlines. -

Emit statements for put

+

Emit statements

As noted above, there are three ways to output out-of-stream variables: (1) Assign them to stream-record fields, e.g. $cumulative_sum = @sum; @@ -1506,7 +1506,7 @@ POKI_RUN_COMMAND{{mlr put -q --oflatsep / '@sum[$a][$b] += $x; end { emitp @sum POKI_RUN_COMMAND{{mlr --oxtab put -q --oflatsep / '@sum[$a][$b] += $x; end { emitp @sum }' data/small}}HERE -

Multi-emit statements for put

+

Multi-emit statements

You can emit multiple out-of-stream variables side-by-side by including their names in parentheses: @@ -1520,7 +1520,7 @@ out-of-stream variables in the emit statement have the same shape and the same keylists. -

Emit-all statements for put

+

Emit-all statements

Use emit all (or emit @* which is synonumous) to output all out-of-stream variables. You can use the following idiom to get various @@ -1531,7 +1531,7 @@ POKI_RUN_COMMAND{{mlr --from data/small --opprint put -q '@sum[$a][$b] += $x; @c POKI_RUN_COMMAND{{mlr --from data/small --opprint put -q '@sum[$a][$b] += $x; @count[$a][$b] += 1; end{emit (@sum, @count),"a","b"}'}}HERE -

Redirected-output statements for put

+

Redirected-output statements

The tee, emitf, emitp, emit, print, and dump keywords all allow you to redirect output to one or more files or @@ -1573,7 +1573,7 @@ POKI_RUN_COMMAND{{mlr --help-keyword dump}}HERE -

Unset statements for put

+

Unset statements

You can clear a map key by assigning the empty string as its value: $x="" or @x="". Using unset you can remove the key entirely. Examples: @@ -1590,7 +1590,7 @@ POKI_RUN_COMMAND{{mlr put -q '@sum[$a][$b] += $x; end { dump; unset @sum["eks"]; variables which have been defined up to that point. -

Filter statements for put

+

Filter statements

You can use filter within put. In fact, the following two are synonymous: diff --git a/doc/reference.html b/doc/reference.html index 4c772666b..88d1f246d 100644 --- a/doc/reference.html +++ b/doc/reference.html @@ -201,23 +201,23 @@ Miller commands were run with pretty-print-tabular output format.         • Built-in variables
        • Field names
        • Local variables
-        • Out-of-stream variables for put
-        • Indexed out-of-stream variables for put
-        • Aggregate variable assignments for put
+        • Out-of-stream variables
+        • Indexed out-of-stream variables
+        • Aggregate variable assignments
        • Keywords for filter and put
    • Control structures
        • Pattern-action blocks
        • If-statements
        • While and do-while loops
        • For-loops
-        • Begin/end blocks for put
-    • Output statements for put
-        • Emit statements for put
-        • Multi-emit statements for put
-        • Emit-all statements for put
-        • Redirected-output statements for put
-    • Unset statements for put
-    • Filter statements for put
+        • Begin/end blocks
+    • Output statements
+        • Emit statements
+        • Multi-emit statements
+        • Emit-all statements
+        • Redirected-output statements
+    • Unset statements
+    • Filter statements
    • Built-in functions for filter and put
    • User-defined functions and subroutines
        • User-defined functions
@@ -4320,7 +4320,7 @@ outer_c 60

-

Out-of-stream variables for put

+

Out-of-stream variables

These are prefixed with an at-sign, e.g. @sum. Furthermore, unlike built-in variables and stream-record fields, they are maintained in an @@ -4377,7 +4377,7 @@ sum=50 etc. -

Indexed out-of-stream variables for put

+

Indexed out-of-stream variables

Using an index on the @count and @sum variables, we get the benefit of the -g (group-by) option which mlr stats1 and various other Miller commands have: @@ -4495,7 +4495,7 @@ num_total=5,num_positive=3

-

Aggregate variable assignments for put

+

Aggregate variable assignments

There are three remaining kinds of variable assignment using out-of-stream variables, the last two of which use the $* syntax: @@ -5287,7 +5287,7 @@ required even if the body is a single statement, or empty. -

Begin/end blocks for put

+

Begin/end blocks

Miller supports an awk-like begin/end syntax. The statements in the begin block are executed before any input records @@ -5401,7 +5401,7 @@ names (beginning with $), since these execute outside the context of input records. -

Output statements for put

+

Output statements

xxx grist: You can output built-in variables indirectly, by assigning them to a non-built-in variable: e.g. $nr = NR adds a field named @@ -5423,7 +5423,7 @@ immediate prints to stdout/stderr. The printn and eprintn keywords are the same except that they don’t print final newlines. -

Emit statements for put

+

Emit statements

As noted above, there are three ways to output out-of-stream variables: (1) Assign them to stream-record fields, e.g. $cumulative_sum = @sum; @@ -5708,7 +5708,7 @@ sum/wye/pan 0.573289

-

Multi-emit statements for put

+

Multi-emit statements

You can emit multiple out-of-stream variables side-by-side by including their names in parentheses: @@ -5763,7 +5763,7 @@ out-of-stream variables in the emit statement have the same shape and the same keylists. -

Emit-all statements for put

+

Emit-all statements

Use emit all (or emit @* which is synonumous) to output all out-of-stream variables. You can use the following idiom to get various @@ -5817,7 +5817,7 @@ wye pan 0.573289 1

-

Redirected-output statements for put

+

Redirected-output statements

The tee, emitf, emitp, emit, print, and dump keywords all allow you to redirect output to one or more files or @@ -6018,7 +6018,7 @@ dump: prints all currently defined out-of-stream variables immediately -

Unset statements for put

+

Unset statements

You can clear a map key by assigning the empty string as its value: $x="" or @x="". Using unset you can remove the key entirely. Examples: @@ -6112,7 +6112,7 @@ $ mlr put -q '@sum[$a][$b] += $x; end { dump; unset @sum["eks"]; dump }' data/sm variables which have been defined up to that point. -

Filter statements for put

+

Filter statements

You can use filter within put. In fact, the following two are synonymous: