mirror of
https://github.com/johnkerl/miller.git
synced 2026-07-17 16:38:54 +00:00
function-doc neaten
This commit is contained in:
parent
f9b7084aab
commit
52d7e452f1
5 changed files with 2132 additions and 314 deletions
2
.gitattributes
vendored
2
.gitattributes
vendored
|
|
@ -10,6 +10,8 @@ out binary
|
|||
|
||||
*.c text eol=lf
|
||||
*.h text eol=lf
|
||||
*.sh text eol=lf
|
||||
*.rb text eol=lf
|
||||
|
||||
*.csv text eol=lf
|
||||
*.dat text eol=lf
|
||||
|
|
|
|||
|
|
@ -329,22 +329,36 @@ static function_lookup_t FUNCTION_LOOKUP_TABLE[] = {
|
|||
{FUNC_CLASS_TYPING, "is_present", 1,0, "True if field is present in input, false otherwise."},
|
||||
{FUNC_CLASS_TYPING, "is_string", 1,0, "True if field is present with string (including empty-string) value"},
|
||||
|
||||
{FUNC_CLASS_TYPING, "asserting_absent", 1,0, "Returns argument if it is absent in the input data, else throws an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_bool", 1,0, "Returns argument if it is present with boolean value, else throws an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_boolean", 1,0, "Returns argument if it is present with boolean value, else throws an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_empty", 1,0, "Returns argument if it is present in input with empty value, else throws an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_empty_map", 1,0, "Returns argument if it is a map with empty value, else throws an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_float", 1,0, "Returns argument if it is present with float value, else throws an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_int", 1,0, "Returns argument if it is present with int value, else throws an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_absent", 1,0, "Returns argument if it is absent in the input data, else\n"
|
||||
"throws an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_bool", 1,0, "Returns argument if it is present with boolean value, else\n"
|
||||
"throws an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_boolean", 1,0, "Returns argument if it is present with boolean value, else\n"
|
||||
"throws an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_empty", 1,0, "Returns argument if it is present in input with empty value,\n"
|
||||
"else throws an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_empty_map", 1,0, "Returns argument if it is a map with empty value, else\n"
|
||||
"throws an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_float", 1,0, "Returns argument if it is present with float value, else\n"
|
||||
"throws an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_int", 1,0, "Returns argument if it is present with int value, else\n"
|
||||
"throws an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_map", 1,0, "Returns argument if it is a map, else throws an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_nonempty_map", 1,0, "Returns argument if it is a non-empty map, else throws an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_not_empty", 1,0, "Returns argument if it is present in input with non-empty value, else throws an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_nonempty_map", 1,0, "Returns argument if it is a non-empty map, else throws\n"
|
||||
"an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_not_empty", 1,0, "Returns argument if it is present in input with non-empty\n"
|
||||
"value, else throws an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_not_map", 1,0, "Returns argument if it is not a map, else throws an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_not_null", 1,0, "Returns argument if it is non-null (non-empty and non-absent), else throws an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_null", 1,0, "Returns argument if it is null (empty or absent), else throws an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_numeric", 1,0, "Returns argument if it is present with int or float value, else throws an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_present", 1,0, "Returns argument if it is present in input, else throws an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_string", 1,0, "Returns argument if it is present with string (including empty-string) value, else throws an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_not_null", 1,0, "Returns argument if it is non-null (non-empty and non-absent),\n"
|
||||
"else throws an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_null", 1,0, "Returns argument if it is null (empty or absent), else throws\n"
|
||||
"an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_numeric", 1,0, "Returns argument if it is present with int or float value,\n"
|
||||
"else throws an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_present", 1,0, "Returns argument if it is present in input, else throws\n"
|
||||
"an error."},
|
||||
{FUNC_CLASS_TYPING, "asserting_string", 1,0, "Returns argument if it is present with string (including\n"
|
||||
"empty-string) value, else throws an error."},
|
||||
|
||||
{FUNC_CLASS_CONVERSION, "boolean", 1,0, "Convert int/float/bool/string to boolean."},
|
||||
{FUNC_CLASS_CONVERSION, "float", 1,0, "Convert int/float/bool/string to float."},
|
||||
|
|
@ -359,18 +373,27 @@ static function_lookup_t FUNCTION_LOOKUP_TABLE[] = {
|
|||
"MT_STRING). For debug."},
|
||||
|
||||
{FUNC_CLASS_MAPS, "depth", 1,0, "Prints maximum depth of hashmap: ''. Scalars have depth 0."},
|
||||
{FUNC_CLASS_MAPS, "haskey", 2,0, "True/false if map has/hasn't key, e.g. 'haskey($*, \"a\")' or 'haskey(mymap, mykey)'. Error if 1st argument is not a map."},
|
||||
{FUNC_CLASS_MAPS, "haskey", 2,0, "True/false if map has/hasn't key, e.g. 'haskey($*, \"a\")' or\n"
|
||||
"'haskey(mymap, mykey)'. Error if 1st argument is not a map."},
|
||||
{FUNC_CLASS_MAPS, "joink", 2,0, "Makes string from map keys. E.g. 'joink($*, \",\")'."},
|
||||
{FUNC_CLASS_MAPS, "joinkv", 3,0, "Makes string from map key-value pairs. E.g. 'joinkv(@v[2], \"=\", \",\")'"},
|
||||
{FUNC_CLASS_MAPS, "joinv", 2,0, "Makes string from map keys. E.g. 'joinv(mymap, \",\")'."},
|
||||
{FUNC_CLASS_MAPS, "leafcount", 1,0, "Counts total number of terminal values in hashmap. For single-level maps, same as length."},
|
||||
{FUNC_CLASS_MAPS, "leafcount", 1,0, "Counts total number of terminal values in hashmap. For single-level maps,\n"
|
||||
"same as length."},
|
||||
{FUNC_CLASS_MAPS, "length", 1,0, "Counts number of top-level entries in hashmap. Scalars have length 1."},
|
||||
{FUNC_CLASS_MAPS, "mapdiff", 0,1, "With 0 args, returns empty map. With 1 arg, returns copy of arg. With 2 or more, returns copy of arg 1 with all keys from any of remaining argument maps removed."},
|
||||
{FUNC_CLASS_MAPS, "mapsum", 0,1, "With 0 args, returns empty map. With >= 1 arg, returns a map with key-value pairs from all arguments. Rightmost collisions win, e.g. 'mapsum({1:2,3,4},{1:5})' is '{1:5,3:4}'."},
|
||||
{FUNC_CLASS_MAPS, "splitkv", 3,0, "Splits string by separators into map with type inference. E.g. 'splitkv(\"a=1,b=2,c=3\", \"=\", \",\")' gives '{\"a\" : 1, \"b\" : 2, \"c\" : 3}'."},
|
||||
{FUNC_CLASS_MAPS, "splitkvx", 3,0, "Splits string by separators into map without type inference (keys and values are strings). E.g. 'splitkv(\"a=1,b=2,c=3\", \"=\", \",\")' gives '{\"a\" : \"1\", \"b\" : \"2\", \"c\" : \"3\"}'."},
|
||||
{FUNC_CLASS_MAPS, "splitnv", 2,0, "Splits string by separator into integer-indexed map with type inference. E.g. 'splitnv(\"a,b,c\" , \",\")' gives '{1 : \"a\", 2 : \"b\", 3 : \"c\"}'."},
|
||||
{FUNC_CLASS_MAPS, "splitnvx", 2,0, "Splits string by separator into integer-indexed map without type inference (values are strings). E.g. 'splitnv(\"4,5,6\" , \",\")' gives '{1 : \"4\", 2 : \"5\", 3 : \"6\"}'."},
|
||||
{FUNC_CLASS_MAPS, "mapdiff", 0,1, "With 0 args, returns empty map. With 1 arg, returns copy of arg.\n"
|
||||
"With 2 or more, returns copy of arg 1 with all keys from any of remaining argument maps removed."},
|
||||
{FUNC_CLASS_MAPS, "mapsum", 0,1, "With 0 args, returns empty map. With >= 1 arg, returns a map with\n"
|
||||
"key-value pairs from all arguments. Rightmost collisions win, e.g. 'mapsum({1:2,3,4},{1:5})' is '{1:5,3:4}'."},
|
||||
{FUNC_CLASS_MAPS, "splitkv", 3,0, "Splits string by separators into map with type inference.\n"
|
||||
"E.g. 'splitkv(\"a=1,b=2,c=3\", \"=\", \",\")' gives '{\"a\" : 1, \"b\" : 2, \"c\" : 3}'."},
|
||||
{FUNC_CLASS_MAPS, "splitkvx", 3,0, "Splits string by separators into map without type inference (keys and\n"
|
||||
"values are strings). E.g. 'splitkv(\"a=1,b=2,c=3\", \"=\", \",\")' gives\n"
|
||||
"'{\"a\" : \"1\", \"b\" : \"2\", \"c\" : \"3\"}'."},
|
||||
{FUNC_CLASS_MAPS, "splitnv", 2,0, "Splits string by separator into integer-indexed map with type inference.\n"
|
||||
"E.g. 'splitnv(\"a,b,c\" , \",\")' gives '{1 : \"a\", 2 : \"b\", 3 : \"c\"}'."},
|
||||
{FUNC_CLASS_MAPS, "splitnvx", 2,0, "Splits string by separator into integer-indexed map without type\n"
|
||||
"inference (values are strings). E.g. 'splitnv(\"4,5,6\" , \",\")' gives '{1 : \"4\", 2 : \"5\", 3 : \"6\"}'."},
|
||||
|
||||
{0, NULL, -1 , -1, NULL}, // table terminator
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1218,43 +1218,267 @@ reference.
|
|||
|
||||
<p/>You can get a list of all functions using <b>mlr -F</b>.
|
||||
|
||||
<h2>Operators</h2>
|
||||
<!--
|
||||
POKI_RUN_UNESCAPED(mk-func-h2s.sh)HERE
|
||||
... or just run the .sh into this file, e.g. '.!mk-func-h2s.sh' in vim
|
||||
mk-func-h2s.sh
|
||||
-->
|
||||
|
||||
<h2>+</h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
+
|
||||
+
|
||||
-
|
||||
-
|
||||
*
|
||||
/
|
||||
//
|
||||
%
|
||||
**
|
||||
|
|
||||
^
|
||||
&
|
||||
~
|
||||
<<
|
||||
>>
|
||||
==
|
||||
!=
|
||||
=~
|
||||
!=~
|
||||
>
|
||||
>=
|
||||
<
|
||||
<=
|
||||
&&
|
||||
||
|
||||
^^
|
||||
!
|
||||
? :
|
||||
.
|
||||
+ (class=arithmetic #args=2): Addition.
|
||||
+ (class=arithmetic #args=1): Unary plus.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2>-</h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
- (class=arithmetic #args=2): Subtraction.
|
||||
- (class=arithmetic #args=1): Unary minus.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2>*</h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
* (class=arithmetic #args=2): Multiplication.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2>/</h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
/ (class=arithmetic #args=2): Division.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2>//</h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
// (class=arithmetic #args=2): Integer division: rounds to negative (pythonic).
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2>%</h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
% (class=arithmetic #args=2): Remainder; never negative-valued (pythonic).
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2>**</h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
** (class=arithmetic #args=2): Exponentiation; same as pow, but as an infix
|
||||
operator.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2>|</h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
| (class=arithmetic #args=2): Bitwise OR.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2>^</h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
^ (class=arithmetic #args=2): Bitwise XOR.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2>&</h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
& (class=arithmetic #args=2): Bitwise AND.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2>~</h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
~ (class=arithmetic #args=1): Bitwise NOT. Beware '$y=~$x' since =~ is the
|
||||
regex-match operator: try '$y = ~$x'.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2><<</h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
<< (class=arithmetic #args=2): Bitwise left-shift.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2>>></h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
>> (class=arithmetic #args=2): Bitwise right-shift.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2>==</h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
== (class=boolean #args=2): String/numeric equality. Mixing number and string
|
||||
results in string compare.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2>!=</h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
!= (class=boolean #args=2): String/numeric inequality. Mixing number and string
|
||||
results in string compare.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2>=~</h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
=~ (class=boolean #args=2): String (left-hand side) matches regex (right-hand
|
||||
side), e.g. '$name =~ "^a.*b$"'.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2>!=~</h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
!=~ (class=boolean #args=2): String (left-hand side) does not match regex
|
||||
(right-hand side), e.g. '$name !=~ "^a.*b$"'.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2>></h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
> (class=boolean #args=2): String/numeric greater-than. Mixing number and string
|
||||
results in string compare.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2>>=</h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
>= (class=boolean #args=2): String/numeric greater-than-or-equals. Mixing number
|
||||
and string results in string compare.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2><</h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
< (class=boolean #args=2): String/numeric less-than. Mixing number and string
|
||||
results in string compare.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2><=</h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
<= (class=boolean #args=2): String/numeric less-than-or-equals. Mixing number
|
||||
and string results in string compare.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2>&&</h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
&& (class=boolean #args=2): Logical AND.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2>||</h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
|| (class=boolean #args=2): Logical OR.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2>^^</h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
^^ (class=boolean #args=2): Logical XOR.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2>!</h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
! (class=boolean #args=1): Logical negation.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2>? :</h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
? : (class=boolean #args=3): Ternary operator.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<h2>.</h2>
|
||||
|
||||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
. (class=string #args=2): String concatenation.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<!-- ================================================================ -->
|
||||
<h2>abs</h2>
|
||||
|
||||
<p/>
|
||||
|
|
@ -1305,8 +1529,8 @@ asinh (class=math #args=1): Inverse hyperbolic sine.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
asserting_absent (class=typing #args=1): Returns argument if it is absent in the
|
||||
input ata, else throws an error.
|
||||
asserting_absent (class=typing #args=1): Returns argument if it is absent in the input data, else
|
||||
throws an error.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1315,8 +1539,8 @@ input ata, else throws an error.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
asserting_bool (class=typing #args=1): Returns argument if it is present with
|
||||
boolean value, else throws an error.
|
||||
asserting_bool (class=typing #args=1): Returns argument if it is present with boolean value, else
|
||||
throws an error.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1325,8 +1549,8 @@ boolean value, else throws an error.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
asserting_boolean (class=typing #args=1): Returns argument if it is present with
|
||||
boolean value, else throws an error.
|
||||
asserting_boolean (class=typing #args=1): Returns argument if it is present with boolean value, else
|
||||
throws an error.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1335,8 +1559,8 @@ boolean value, else throws an error.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
asserting_empty (class=typing #args=1): Returns argument if it is present in
|
||||
input with empty value, else throws an error.
|
||||
asserting_empty (class=typing #args=1): Returns argument if it is present in input with empty value,
|
||||
else throws an error.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1345,8 +1569,8 @@ input with empty value, else throws an error.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
asserting_empty_map (class=typing #args=1): Returns argument if it is a map with
|
||||
empty value, else throws an error.
|
||||
asserting_empty_map (class=typing #args=1): Returns argument if it is a map with empty value, else
|
||||
throws an error.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1355,8 +1579,8 @@ empty value, else throws an error.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
asserting_float (class=typing #args=1): Returns argument if it is present with
|
||||
float value, else throws an error.
|
||||
asserting_float (class=typing #args=1): Returns argument if it is present with float value, else
|
||||
throws an error.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1365,8 +1589,8 @@ float value, else throws an error.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
asserting_int (class=typing #args=1): Returns argument if it is present with int
|
||||
value, else throws an error.
|
||||
asserting_int (class=typing #args=1): Returns argument if it is present with int value, else
|
||||
throws an error.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1375,8 +1599,7 @@ value, else throws an error.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
asserting_map (class=typing #args=1): Returns argument if it is a map, else
|
||||
throws an error.
|
||||
asserting_map (class=typing #args=1): Returns argument if it is a map, else throws an error.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1385,8 +1608,8 @@ throws an error.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
asserting_nonempty_map (class=typing #args=1): Returns argument if it is a
|
||||
non-empty map, else throws an error.
|
||||
asserting_nonempty_map (class=typing #args=1): Returns argument if it is a non-empty map, else throws
|
||||
an error.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1395,8 +1618,8 @@ non-empty map, else throws an error.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
asserting_not_empty (class=typing #args=1): Returns argument if it is present in
|
||||
input with non-empty value, else throws an error.
|
||||
asserting_not_empty (class=typing #args=1): Returns argument if it is present in input with non-empty
|
||||
value, else throws an error.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1405,8 +1628,7 @@ input with non-empty value, else throws an error.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
asserting_not_map (class=typing #args=1): Returns argument if it is not a map,
|
||||
else throws an error.
|
||||
asserting_not_map (class=typing #args=1): Returns argument if it is not a map, else throws an error.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1415,8 +1637,8 @@ else throws an error.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
asserting_not_null (class=typing #args=1): Returns argument if it is non-null
|
||||
(non-empty and non-absent), else throws an error.
|
||||
asserting_not_null (class=typing #args=1): Returns argument if it is non-null (non-empty and non-absent),
|
||||
else throws an error.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1425,8 +1647,8 @@ asserting_not_null (class=typing #args=1): Returns argument if it is non-null
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
asserting_null (class=typing #args=1): Returns argument if it is null (empty or
|
||||
absent), else throws an error.
|
||||
asserting_null (class=typing #args=1): Returns argument if it is null (empty or absent), else throws
|
||||
an error.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1435,8 +1657,8 @@ absent), else throws an error.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
asserting_numeric (class=typing #args=1): Returns argument if it is present with
|
||||
int or float value, else throws an error.
|
||||
asserting_numeric (class=typing #args=1): Returns argument if it is present with int or float value,
|
||||
else throws an error.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1445,8 +1667,8 @@ int or float value, else throws an error.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
asserting_present (class=typing #args=1): Returns argument if it is present in
|
||||
input, else throws an error.
|
||||
asserting_present (class=typing #args=1): Returns argument if it is present in input, else throws
|
||||
an error.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1455,8 +1677,8 @@ input, else throws an error.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
asserting_string (class=typing #args=1): Returns argument if it is present with
|
||||
string (including empty-string) value, else throws an error.
|
||||
asserting_string (class=typing #args=1): Returns argument if it is present with string (including
|
||||
empty-string) value, else throws an error.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1537,8 +1759,7 @@ cosh (class=math #args=1): Hyperbolic cosine.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
depth (class=maps #args=1): Prints maximum depth of hashmap: ''. Scalars have
|
||||
depth 0.
|
||||
depth (class=maps #args=1): Prints maximum depth of hashmap: ''. Scalars have depth 0.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1651,8 +1872,8 @@ fsec2hms(5000.25) = "01:23:20.250000"
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
gmt2sec (class=time #args=1): Parses GMT timestamp as integer seconds since the
|
||||
epoch.
|
||||
gmt2sec (class=time #args=1): Parses GMT timestamp as integer seconds since
|
||||
the epoch.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1661,8 +1882,8 @@ epoch.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
gsub (class=string #args=3): Example: '$name=gsub($name, "old", "new")' (replace
|
||||
all).
|
||||
gsub (class=string #args=3): Example: '$name=gsub($name, "old", "new")'
|
||||
(replace all).
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1671,8 +1892,8 @@ all).
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
haskey (class=maps #args=2): True/false if map has/hasn't key, e.g. 'haskey($*,
|
||||
"a")' or 'haskey(mymap, mykey)'. Error if 1st argument is not a map.
|
||||
haskey (class=maps #args=2): True/false if map has/hasn't key, e.g. 'haskey($*, "a")' or
|
||||
'haskey(mymap, mykey)'. Error if 1st argument is not a map.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1700,8 +1921,8 @@ hms2fsec("01:23:20.250000") = 5000.250000
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
hms2sec (class=time #args=1): Recovers integer seconds as in hms2sec("01:23:20")
|
||||
= 5000
|
||||
hms2sec (class=time #args=1): Recovers integer seconds as in
|
||||
hms2sec("01:23:20") = 5000
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1729,8 +1950,7 @@ function. Note that invqorm(urand()) is normally distributed.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
is_absent (class=typing #args=1): False if field is present in input, false
|
||||
otherwise
|
||||
is_absent (class=typing #args=1): False if field is present in input, false otherwise
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1739,8 +1959,7 @@ otherwise
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
is_bool (class=typing #args=1): True if field is present with boolean value.
|
||||
Synonymous with is_boolean.
|
||||
is_bool (class=typing #args=1): True if field is present with boolean value. Synonymous with is_boolean.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1749,8 +1968,7 @@ Synonymous with is_boolean.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
is_boolean (class=typing #args=1): True if field is present with boolean value.
|
||||
Synonymous with is_bool.
|
||||
is_boolean (class=typing #args=1): True if field is present with boolean value. Synonymous with is_bool.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1759,8 +1977,7 @@ Synonymous with is_bool.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
is_empty (class=typing #args=1): True if field is present in input with empty
|
||||
string value, false otherwise.
|
||||
is_empty (class=typing #args=1): True if field is present in input with empty string value, false otherwise.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1778,8 +1995,7 @@ is_empty_map (class=typing #args=1): True if argument is a map which is empty.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
is_float (class=typing #args=1): True if field is present with value inferred to
|
||||
be float
|
||||
is_float (class=typing #args=1): True if field is present with value inferred to be float
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1788,8 +2004,7 @@ be float
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
is_int (class=typing #args=1): True if field is present with value inferred to
|
||||
be int
|
||||
is_int (class=typing #args=1): True if field is present with value inferred to be int
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1807,8 +2022,7 @@ is_map (class=typing #args=1): True if argument is a map.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
is_nonempty_map (class=typing #args=1): True if argument is a map which is
|
||||
non-empty.
|
||||
is_nonempty_map (class=typing #args=1): True if argument is a map which is non-empty.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1817,8 +2031,7 @@ non-empty.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
is_not_empty (class=typing #args=1): False if field is present in input with
|
||||
empty value, false otherwise
|
||||
is_not_empty (class=typing #args=1): False if field is present in input with empty value, false otherwise
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1836,8 +2049,7 @@ is_not_map (class=typing #args=1): True if argument is not a map.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
is_not_null (class=typing #args=1): False if argument is null (empty or absent),
|
||||
true otherwise.
|
||||
is_not_null (class=typing #args=1): False if argument is null (empty or absent), true otherwise.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1846,8 +2058,7 @@ true otherwise.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
is_null (class=typing #args=1): True if argument is null (empty or absent),
|
||||
false otherwise.
|
||||
is_null (class=typing #args=1): True if argument is null (empty or absent), false otherwise.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1856,8 +2067,7 @@ false otherwise.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
is_numeric (class=typing #args=1): True if field is present with value inferred
|
||||
to be int or float
|
||||
is_numeric (class=typing #args=1): True if field is present with value inferred to be int or float
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1866,8 +2076,7 @@ to be int or float
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
is_present (class=typing #args=1): True if field is present in input, false
|
||||
otherwise.
|
||||
is_present (class=typing #args=1): True if field is present in input, false otherwise.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1876,8 +2085,7 @@ otherwise.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
is_string (class=typing #args=1): True if field is present with string
|
||||
(including empty-string) value
|
||||
is_string (class=typing #args=1): True if field is present with string (including empty-string) value
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1895,8 +2103,7 @@ joink (class=maps #args=2): Makes string from map keys. E.g. 'joink($*, ",")'.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
joinkv (class=maps #args=3): Makes string from map key-value pairs. E.g.
|
||||
'joinkv(@v[2], "=", ",")'
|
||||
joinkv (class=maps #args=3): Makes string from map key-value pairs. E.g. 'joinkv(@v[2], "=", ",")'
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1905,8 +2112,7 @@ joinkv (class=maps #args=3): Makes string from map key-value pairs. E.g.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
joinv (class=maps #args=2): Makes string from map keys. E.g. 'joinv(mymap,
|
||||
",")'.
|
||||
joinv (class=maps #args=2): Makes string from map keys. E.g. 'joinv(mymap, ",")'.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1915,8 +2121,8 @@ joinv (class=maps #args=2): Makes string from map keys. E.g. 'joinv(mymap,
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
leafcount (class=maps #args=1): Counts total number of terminal values in
|
||||
hashmap. For single-level maps, same as length.
|
||||
leafcount (class=maps #args=1): Counts total number of terminal values in hashmap. For single-level maps,
|
||||
same as length.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1925,8 +2131,7 @@ hashmap. For single-level maps, same as length.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
length (class=maps #args=1): Counts number of top-level entries in hashmap.
|
||||
Scalars have length 1.
|
||||
length (class=maps #args=1): Counts number of top-level entries in hashmap. Scalars have length 1.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1981,9 +2186,8 @@ madd (class=math #args=3): a + b mod m (integers)
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
mapdiff (class=maps variadic): With 0 args, returns empty map. With 1 arg,
|
||||
returns copy of arg. With 2 or more, returns copy of arg 1 with all keys from
|
||||
any of remaining argument maps removed.
|
||||
mapdiff (class=maps variadic): With 0 args, returns empty map. With 1 arg, returns copy of arg.
|
||||
With 2 or more, returns copy of arg 1 with all keys from any of remaining argument maps removed.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1992,9 +2196,8 @@ any of remaining argument maps removed.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
mapsum (class=maps variadic): With 0 args, returns empty map. With >= 1 arg,
|
||||
returns a map with key-value pairs from all arguments. Rightmost collisions win,
|
||||
e.g. 'mapsum({1:2,3,4},{1:5})' is '{1:5,3:4}'.
|
||||
mapsum (class=maps variadic): With 0 args, returns empty map. With >= 1 arg, returns a map with
|
||||
key-value pairs from all arguments. Rightmost collisions win, e.g. 'mapsum({1:2,3,4},{1:5})' is '{1:5,3:4}'.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -2085,8 +2288,8 @@ the same as round($x/$m)*$m
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
sec2dhms (class=time #args=1): Formats integer seconds as in sec2dhms(500000) =
|
||||
"5d18h53m20s"
|
||||
sec2dhms (class=time #args=1): Formats integer seconds as in sec2dhms(500000)
|
||||
= "5d18h53m20s"
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -2095,9 +2298,9 @@ sec2dhms (class=time #args=1): Formats integer seconds as in sec2dhms(500000) =
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
sec2gmt (class=time #args=1): Formats seconds since epoch (integer part) as GMT
|
||||
timestamp, e.g. sec2gmt(1440768801.7) = "2015-08-28T13:33:21Z". Leaves
|
||||
non-numbers as-is.
|
||||
sec2gmt (class=time #args=1): Formats seconds since epoch (integer part)
|
||||
as GMT timestamp, e.g. sec2gmt(1440768801.7) = "2015-08-28T13:33:21Z".
|
||||
Leaves non-numbers as-is.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -2106,9 +2309,9 @@ non-numbers as-is.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
sec2gmtdate (class=time #args=1): Formats seconds since epoch (integer part) as
|
||||
GMT timestamp with year-month-date, e.g. sec2gmtdate(1440768801.7) =
|
||||
"2015-08-28". Leaves non-numbers as-is.
|
||||
sec2gmtdate (class=time #args=1): Formats seconds since epoch (integer part)
|
||||
as GMT timestamp with year-month-date, e.g. sec2gmtdate(1440768801.7) = "2015-08-28".
|
||||
Leaves non-numbers as-is.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -2117,8 +2320,8 @@ GMT timestamp with year-month-date, e.g. sec2gmtdate(1440768801.7) =
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
sec2hms (class=time #args=1): Formats integer seconds as in sec2hms(5000) =
|
||||
"01:23:20"
|
||||
sec2hms (class=time #args=1): Formats integer seconds as in
|
||||
sec2hms(5000) = "01:23:20"
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -2155,9 +2358,8 @@ sinh (class=math #args=1): Hyperbolic sine.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
splitkv (class=maps #args=3): Splits string by separators into map with type
|
||||
inference. E.g. 'splitkv("a=1,b=2,c=3", "=", ",")' gives '{"a" : 1, "b" : 2, "c"
|
||||
: 3}'.
|
||||
splitkv (class=maps #args=3): Splits string by separators into map with type inference.
|
||||
E.g. 'splitkv("a=1,b=2,c=3", "=", ",")' gives '{"a" : 1, "b" : 2, "c" : 3}'.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -2166,9 +2368,9 @@ inference. E.g. 'splitkv("a=1,b=2,c=3", "=", ",")' gives '{"a" : 1, "b" : 2, "c"
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
splitkvx (class=maps #args=3): Splits string by separators into map without type
|
||||
inference (keys and values are strings). E.g. 'splitkv("a=1,b=2,c=3", "=", ",")'
|
||||
gives '{"a" : "1", "b" : "2", "c" : "3"}'.
|
||||
splitkvx (class=maps #args=3): Splits string by separators into map without type inference (keys and
|
||||
values are strings). E.g. 'splitkv("a=1,b=2,c=3", "=", ",")' gives
|
||||
'{"a" : "1", "b" : "2", "c" : "3"}'.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -2177,9 +2379,8 @@ gives '{"a" : "1", "b" : "2", "c" : "3"}'.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
splitnv (class=maps #args=2): Splits string by separator into integer-indexed
|
||||
map with type inference. E.g. 'splitnv("a,b,c" , ",")' gives '{1 : "a", 2 : "b",
|
||||
3 : "c"}'.
|
||||
splitnv (class=maps #args=2): Splits string by separator into integer-indexed map with type inference.
|
||||
E.g. 'splitnv("a,b,c" , ",")' gives '{1 : "a", 2 : "b", 3 : "c"}'.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -2188,9 +2389,8 @@ map with type inference. E.g. 'splitnv("a,b,c" , ",")' gives '{1 : "a", 2 : "b",
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
splitnvx (class=maps #args=2): Splits string by separator into integer-indexed
|
||||
map without type inference (values are strings). E.g. 'splitnv("4,5,6" , ",")'
|
||||
gives '{1 : "4", 2 : "5", 3 : "6"}'.
|
||||
splitnvx (class=maps #args=2): Splits string by separator into integer-indexed map without type
|
||||
inference (values are strings). E.g. 'splitnv("4,5,6" , ",")' gives '{1 : "4", 2 : "5", 3 : "6"}'.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -2208,9 +2408,9 @@ sqrt (class=math #args=1): Square root.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
strftime (class=time #args=2): Formats seconds since epoch (integer part) as
|
||||
timestamp, e.g. strftime(1440768801.7,"%Y-%m-%dT%H:%M:%SZ") =
|
||||
"2015-08-28T13:33:21Z".
|
||||
strftime (class=time #args=2): Formats seconds since epoch (integer part)
|
||||
as timestamp, e.g.
|
||||
strftime(1440768801.7,"%Y-%m-%dT%H:%M:%SZ") = "2015-08-28T13:33:21Z".
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -2247,8 +2447,8 @@ e.g. strptime("2015-08-28T13:33:21Z","%Y-%m-%dT%H:%M:%SZ") = 1440768801.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
sub (class=string #args=3): Example: '$name=sub($name, "old", "new")' (replace
|
||||
once).
|
||||
sub (class=string #args=3): Example: '$name=sub($name, "old", "new")'
|
||||
(replace once).
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -2257,8 +2457,8 @@ once).
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
substr (class=string #args=3): substr(s,m,n) gives substring of s from 0-up
|
||||
position m to n inclusive. Negative indices -len .. -1 alias to 0 .. len-1.
|
||||
substr (class=string #args=3): substr(s,m,n) gives substring of s from 0-up position m to n
|
||||
inclusive. Negative indices -len .. -1 alias to 0 .. len-1.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -2267,8 +2467,8 @@ position m to n inclusive. Negative indices -len .. -1 alias to 0 .. len-1.
|
|||
<p/>
|
||||
<div class="pokipanel">
|
||||
<pre>
|
||||
systime (class=time #args=0): Floating-point seconds since the epoch, e.g.
|
||||
1440768801.748936.
|
||||
systime (class=time #args=0): Floating-point seconds since the epoch,
|
||||
e.g. 1440768801.748936.
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,26 @@
|
|||
#!/bin/bash
|
||||
|
||||
while read funcname; do
|
||||
mlr -F | grep -v '^[a-zA-Z]' | uniq | while read funcname; do
|
||||
echo "<h2>$funcname</h2>"
|
||||
echo ""
|
||||
echo "<p/>"
|
||||
echo '<div class="pokipanel">'
|
||||
echo '<pre>'
|
||||
mlr --help-function $funcname | fmt -80
|
||||
mlr --help-function "$funcname"
|
||||
echo '</pre>'
|
||||
echo '</div>'
|
||||
echo ""
|
||||
done
|
||||
|
||||
mlr -F | grep '^[a-zA-Z]' | sort -u | while read funcname; do
|
||||
echo "<h2>$funcname</h2>"
|
||||
echo ""
|
||||
echo "<p/>"
|
||||
echo '<div class="pokipanel">'
|
||||
echo '<pre>'
|
||||
mlr --help-function "$funcname"
|
||||
echo '</pre>'
|
||||
echo '</div>'
|
||||
echo ""
|
||||
done
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue