mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-25 08:53:55 +00:00
uninit-disposition iterate
This commit is contained in:
parent
ccd79dac82
commit
7dd25327b2
2 changed files with 6 additions and 29 deletions
|
|
@ -10,32 +10,7 @@
|
|||
#include "containers/mlrval.h"
|
||||
|
||||
// ================================================================
|
||||
// NOTES:
|
||||
//
|
||||
// * This is used by mlr filter and mlr put, as well as by other
|
||||
// verbs which do integer-preservation logic (i.e. they produce
|
||||
// integer output given integer input).
|
||||
//
|
||||
// * Unlike most files in Miller which are read top-down (with sufficient
|
||||
// static prototypes at the top of the file to keep the compiler happy),
|
||||
// please read this one from the bottom up. There are very many short
|
||||
// functions and I chose not to write out so many prototypes: they would have
|
||||
// made things less clear by their very volume.
|
||||
//
|
||||
// * Comparison to rval_evaluators.c: this file is functions from mlrval(s) to
|
||||
// mlrval; in rval_evaluators.c we have the higher-level notion of
|
||||
// evaluating lrec objects, using mlrval.c to do so.
|
||||
//
|
||||
// * There are two kinds of functions here: those with _x_ in their names
|
||||
// which accept various types of mlrval, with disposition-matrices in
|
||||
// mlrval.c functions, and those with _i_/_f_/_b_/_s_ (int, float, boolean,
|
||||
// string) which either type-check or type-coerce their arguments, invoking
|
||||
// type-specific functions in mlrval.c. Those with _n_ take int or float
|
||||
// and also use disposition matrices. In all cases it's the job of
|
||||
// the calling routines to invoke functions here with mlrvals of the correct
|
||||
// type(s).
|
||||
//
|
||||
// See also important notes at the top of mlrval.h.
|
||||
// See important notes at the top of mlrval.h.
|
||||
// ================================================================
|
||||
|
||||
// For some Linux distros, in spite of including time.h:
|
||||
|
|
|
|||
|
|
@ -59,12 +59,14 @@ PARAMETERIZED EMIT
|
|||
================================================================
|
||||
TRI-SPLIT NULL, AND += ET AL.
|
||||
|
||||
* recheck all numerics of void
|
||||
! UTs
|
||||
-
|
||||
mlr put '@sum += $x; filter false; end{emit @sum}' ../data/small
|
||||
mlr put '@sum += $x; filter false; end{emit(@sum)}' ../data/small
|
||||
mlr put '@sum[$a] += $x; filter false; end{emit(@sum, "a")}' ../data/small
|
||||
|
||||
* UTs
|
||||
* to mld:ref
|
||||
|
||||
* explicit initialization OK:
|
||||
|
||||
mlr --opprint put -v 'begin {@count=0; @sum=0.0}; @count=@count+1; @sum=@sum+$x; end{@mean=@sum/@count; emit @mean}' ../data/small
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue