"Fossies" - the Fresh Open Source Software Archive

Member "mlr-5.9.1/c/reg_test/run" (3 Sep 2020, 278510 Bytes) of package /linux/misc/mlr-5.9.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "run": 5.9.0_vs_5.9.1.

    1 #!/bin/sh
    2 
    3 # ================================================================
    4 set -e
    5 
    6 # For building with autoconf:
    7 # * in-directory build:
    8 #   pwd                  is /path/to/the/tree/c/reg_test
    9 #   path to mlr          is /path/to/the/tree/c/mlr
   10 #   path to reg_test/run is /path/to/the/tree/c/reg_test/run
   11 #
   12 # * out-of-directory ("VPATH") build:
   13 #   pwd                  is /path/to/build/tree/c/reg_test
   14 #   path to mlr          is /path/to/build/tree/c/mlr
   15 #   path to reg_test/run is /path/to/source/tree/c/reg_test/run
   16 
   17 # For building without autoconf:
   18 #   pwd                  is /does/not/matter
   19 #   path to mlr          is /path/to/the/tree/c/mlr
   20 #   path to reg_test/run is /path/to/the/tree/c/reg_test/run
   21 
   22 ourdir=`dirname $0`
   23 srcdir=$ourdir/../..
   24 pwd=`pwd`
   25 
   26 try1=$pwd/../mlr    # For autoconf builds, in-tree or out-of-tree
   27 try2=$srcdir/c/mlr  # For non-autoconf builds
   28 if [ -x "$try1" ]; then
   29   path_to_mlr=$try1
   30 elif [ -x "$try2" ]; then
   31   path_to_mlr=$try2
   32 else
   33   echo "$0: Could not find path to mlr executable." 1>&2
   34   echo "Try 1: $try1" 1>&2
   35   echo "Try 2: $try2" 1>&2
   36   exit 1
   37 fi
   38 
   39 # mlr lecat, mlr termcvt, etc. do not accept initial '--no-mmap'.
   40 path_to_mlr_for_auxents="$path_to_mlr"
   41 
   42 if [ "$1" = "--valgrind" ]; then
   43   # Leak-check the test suite. Needs 'make mlrg' first.
   44   # ../tools/clean-valg can be used to filter the output.
   45   path_to_mlr="valgrind --leak-check=full ${path_to_mlr}g"
   46   path_to_mlr_for_auxents="$path_to_mlr"
   47 fi
   48 echo Using mlr executable $path_to_mlr
   49 
   50 indir=$ourdir/input
   51 expdir=$ourdir/expected
   52 outdir=$pwd/output-regtest
   53 reloutdir=./output-regtest
   54 outfile=$outdir/out
   55 expfile=$expdir/out
   56 mkdir -p $outdir
   57 
   58 # Don't let the running user's .mlrrc affect the regression test
   59 export MLRRC="__none__"
   60 
   61 rm -rf $outdir
   62 mkdir -p $outdir
   63 touch $outfile
   64 echo
   65 
   66 num_completed=0
   67 
   68 announce() {
   69   echo >> $outfile
   70   echo "================================================================" >> $outfile
   71   echo "$@" >> $outfile
   72   echo >> $outfile
   73 }
   74 
   75 mention() {
   76   echo >> $outfile
   77   echo ---------------------------------------------------------------- "$@" >> $outfile
   78 }
   79 
   80 # A key feature of this regression script is that it can be invoked from any
   81 # directory. Depending on the directory it's invoked from, the path to the mlr
   82 # executable may vary.  Nonetheless for debugging it's crucial that we echo out
   83 # each command being executed. See also diff -I below.
   84 run_mlr() {
   85   # Use just "mlr" for info messages
   86   echo mlr "$@"
   87   echo mlr "$@" >> $outfile
   88   # Use path to mlr for invoking the command
   89   $path_to_mlr "$@" >> $outfile
   90   echo >> $outfile
   91   # since set -e
   92   num_completed=`expr $num_completed + 1`
   93 }
   94 
   95 run_cat() {
   96   echo cat "$@"
   97   echo cat "$@" >> $outfile
   98   cat "$@" >> $outfile
   99   echo >> $outfile
  100 }
  101 
  102 run_mlr_for_auxents() {
  103   # Use just "mlr" for info messages
  104   echo mlr "$@" >> $outfile
  105   # Use path to mlr for invoking the command
  106   $path_to_mlr_for_auxents "$@" >> $outfile
  107   # since set -e
  108   num_completed=`expr $num_completed + 1`
  109 }
  110 
  111 run_mlr_for_auxents_no_output() {
  112   # Use just "mlr" for info messages
  113   echo mlr "$@" >> $outfile
  114   # Use path to mlr for invoking the command
  115   $path_to_mlr_for_auxents "$@"
  116   # since set -e
  117   num_completed=`expr $num_completed + 1`
  118 }
  119 
  120 # Just cats a file while also announcing that fact.
  121 run_cat() {
  122   echo cat "$@"
  123   echo cat "$@" >> $outfile # for diff at end
  124   cat "$@" >> $outfile      # for diff at end
  125   echo >> $outfile
  126 }
  127 
  128 mlr_expect_fail() {
  129   # Use just "mlr" for info messages
  130   echo mlr "$@"
  131   echo mlr "$@" >> $outfile
  132   # Use path to mlr for invoking the command
  133   set +e
  134   stderr_capture=$( $path_to_mlr "$@" 3>&1 1>&2 2>&3 >>$outfile )
  135   status=$?
  136   echo "${stderr_capture}" >> $outfile
  137   if [ $status -ne 1 ]; then
  138     echo "Exit status was $status; expected 1."
  139     echo "Exit status was $status; expected 1." >> $outfile
  140   fi
  141   set -e
  142   echo >> $outfile
  143   test $status -eq 1
  144   # since set -e
  145   num_completed=`expr $num_completed + 1`
  146 }
  147 
  148 # ================================================================
  149 announce STATELESS MAPPERS
  150 
  151 run_mlr cat $indir/abixy
  152 run_mlr cat /dev/null
  153 
  154 run_mlr cat -n $indir/abixy-het
  155 run_mlr cat -N counter $indir/abixy-het
  156 
  157 run_mlr cat -g a,b $indir/abixy-het
  158 run_mlr cat -g a,b $indir/abixy-het
  159 
  160 run_mlr cat -g a,b -n $indir/abixy-het
  161 run_mlr cat -g a,b -N counter $indir/abixy-het
  162 
  163 run_mlr cut -f a,x $indir/abixy
  164 run_mlr cut --complement -f a,x $indir/abixy
  165 
  166 run_mlr cut -r    -f c,e         $indir/having-fields-regex.dkvp
  167 run_mlr cut -r    -f '"C","E"'   $indir/having-fields-regex.dkvp
  168 run_mlr cut -r    -f '"c"i,"e"'  $indir/having-fields-regex.dkvp
  169 run_mlr cut -r    -f '"C"i,"E"'  $indir/having-fields-regex.dkvp
  170 run_mlr cut -r -x -f c,e         $indir/having-fields-regex.dkvp
  171 run_mlr cut -r -x -f '"C","E"'   $indir/having-fields-regex.dkvp
  172 run_mlr cut -r -x -f '"C","E"i'  $indir/having-fields-regex.dkvp
  173 run_mlr cut -r -x -f '"c","e"i'  $indir/having-fields-regex.dkvp
  174 
  175 run_mlr --csvlite cut -r -f '^Name$,^Date_[0-9].*$' $indir/date1.csv $indir/date2.csv
  176 
  177 run_mlr having-fields --at-least  a,b         $indir/abixy
  178 run_mlr having-fields --at-least  a,c         $indir/abixy
  179 run_mlr having-fields --at-least  a,b,i,x,y   $indir/abixy
  180 run_mlr having-fields --which-are a,b,i,x     $indir/abixy
  181 run_mlr having-fields --which-are a,b,i,x,y   $indir/abixy
  182 run_mlr having-fields --which-are a,b,i,y,x   $indir/abixy
  183 run_mlr having-fields --which-are a,b,i,x,w   $indir/abixy
  184 run_mlr having-fields --which-are a,b,i,x,y,z $indir/abixy
  185 run_mlr having-fields --at-most   a,c         $indir/abixy
  186 run_mlr having-fields --at-most   a,b,i,x,y   $indir/abixy
  187 run_mlr having-fields --at-most   a,b,i,x,y,z $indir/abixy
  188 
  189 run_mlr having-fields --all-matching  '"^[a-z][a-z][a-z]$"'  $indir/having-fields-regex.dkvp
  190 run_mlr having-fields --any-matching  '"^[a-z][a-z][a-z]$"'  $indir/having-fields-regex.dkvp
  191 run_mlr having-fields --none-matching '"^[a-z][a-z][a-z]$"'  $indir/having-fields-regex.dkvp
  192 run_mlr having-fields --all-matching  '"^[a-z][a-z][a-z]$"i' $indir/having-fields-regex.dkvp
  193 run_mlr having-fields --any-matching  '"^[a-z][a-z][a-z]$"i' $indir/having-fields-regex.dkvp
  194 run_mlr having-fields --none-matching '"^[a-z][a-z][a-z]$"i' $indir/having-fields-regex.dkvp
  195 
  196 run_mlr rename b,BEE,x,EKS $indir/abixy
  197 run_mlr rename nonesuch,nonesuch,x,EKS $indir/abixy
  198 
  199 run_mlr         label NEW             $indir/abixy
  200 run_mlr         label a,NEW,c         $indir/abixy
  201 run_mlr         label 1,2,3,4,5,6,7,8 $indir/abixy
  202 run_mlr         label d,x,f           $indir/abixy
  203 mlr_expect_fail label d,x,d           $indir/abixy
  204 
  205 run_mlr --csvlite rename -r    '^Date_[0-9].*$,Date'  $indir/date1.csv $indir/date2.csv
  206 run_mlr --csvlite rename -r    '(.*)e(.*),\1EEE\2'    $indir/date1.csv $indir/date2.csv
  207 run_mlr --csvlite rename -r    '"(.*)e(.*)"i,\1EEE\2' $indir/date1.csv $indir/date2.csv
  208 run_mlr --csvlite rename -r -g '"(.*)e(.*)"i,\1EEE\2' $indir/date1.csv $indir/date2.csv
  209 run_mlr --csvlite rename -r    '^(.a.e)(_.*)?,AA\1BB\2CC' $indir/date1.csv
  210 run_mlr --csvlite rename -r    '"e",EEE'              $indir/date1.csv $indir/date2.csv
  211 run_mlr --csvlite rename -r -g '"e",EEE'              $indir/date1.csv $indir/date2.csv
  212 run_mlr --csvlite rename -r    '"e"i,EEE'             $indir/date1.csv $indir/date2.csv
  213 run_mlr --csvlite rename -r -g '"e"i,EEE'             $indir/date1.csv $indir/date2.csv
  214 
  215 run_mlr regularize $indir/regularize.dkvp
  216 
  217 run_mlr --opprint bar -f x,y --lo 0 --hi 1 $indir/abixy
  218 run_mlr --opprint bar -f x,y -c c -x x -b b --lo 0.1 --hi 0.9 -w 20 $indir/abixy
  219 run_mlr --opprint bar --auto -f x,y -w 10 $indir/abixy
  220 
  221 run_mlr altkv <<EOF
  222 a,b,c,d,e,f
  223 EOF
  224 run_mlr altkv <<EOF
  225 a,b,c,d,e,f,g
  226 EOF
  227 
  228 # ----------------------------------------------------------------
  229 announce TRIVIAL RETAINERS
  230 
  231 run_mlr group-by a   $indir/abixy
  232 run_mlr group-by a,b $indir/abixy
  233 
  234 run_mlr group-like $indir/het.dkvp
  235 
  236 run_mlr tac $indir/abixy
  237 run_mlr tac /dev/null
  238 
  239 run_mlr --opprint unsparsify $indir/abixy
  240 run_mlr --opprint unsparsify $indir/abixy-het
  241 
  242 run_mlr --csv skip-trivial-records $indir/trivial-records.csv
  243 run_mlr --csv remove-empty-columns $indir/remove-empty-columns.csv
  244 
  245 run_mlr format-values $indir/abixy
  246 run_mlr format-values -n $indir/abixy
  247 run_mlr format-values -i %08llx -f %.6le -s X%sX $indir/abixy
  248 run_mlr format-values -i %08llx -f %.6le -s X%sX -n $indir/abixy
  249 
  250 # ----------------------------------------------------------------
  251 announce HEAD/TAIL/ETC.
  252 
  253 run_mlr head -n 2        $indir/abixy-het
  254 run_mlr head -n 2 -g a   $indir/abixy-het
  255 run_mlr head -n 2 -g a,b $indir/abixy-het
  256 
  257 # Test allowing then-chains to start with an initial 'then'
  258 run_mlr \
  259     then cat \
  260     then head -n 2 -g a,b \
  261     then tac \
  262     $indir/abixy-het
  263 
  264 # Test early-out for unkeyed head
  265 run_mlr head -n 2 then put 'end{ print "Final NR is ".NR}' $indir/abixy-wide
  266 run_mlr head -n 2 -g a then put 'end{ print "Final NR is ".NR}' $indir/abixy-wide
  267 run_mlr cat then head -n 2 then put 'end{ print "Final NR is ".NR}' $indir/abixy-wide
  268 run_mlr tac then head -n 2 then put 'end{ print "Final NR is ".NR}' $indir/abixy-wide
  269 run_mlr head -n 2 then put 'end{ print "Final NR is ".NR}' $indir/abixy-wide $indir/abixy-wide $indir/abixy-wide
  270 
  271 run_mlr tail -n 2        $indir/abixy-het
  272 run_mlr tail -n 2 -g a   $indir/abixy-het
  273 run_mlr tail -n 2 -g a,b $indir/abixy-het
  274 
  275 run_mlr top -f x,y -n 2        $indir/abixy-het
  276 run_mlr top -f x,y -n 2 -g a   $indir/abixy-het
  277 run_mlr top -f x,y -n 2 -g a,b $indir/abixy-het
  278 
  279 run_mlr top -f x,y -n 2        $indir/ints.dkvp
  280 run_mlr top -f x,y -n 2 -F     $indir/ints.dkvp
  281 
  282 run_mlr top    -n 4 -f x        $indir/abixy-wide
  283 run_mlr top    -n 1 -f x,y      $indir/abixy-wide
  284 run_mlr top    -n 4 -f x   -g a $indir/abixy-wide
  285 run_mlr top    -n 1 -f x,y -g a $indir/abixy-wide
  286 run_mlr top -a -n 4 -f x        $indir/abixy-wide
  287 run_mlr top -a -n 4 -f x   -g a $indir/abixy-wide
  288 
  289 run_mlr top    -n 3 -f x,y       $indir/near-ovf.dkvp
  290 run_mlr top    -n 3 -f x,y --min $indir/near-ovf.dkvp
  291 run_mlr top -F -n 3 -f x,y       $indir/near-ovf.dkvp
  292 run_mlr top -F -n 3 -f x,y --min $indir/near-ovf.dkvp
  293 
  294 run_mlr --seed 12345 bootstrap       $indir/abixy-het
  295 run_mlr --seed 12345 bootstrap -n  2 $indir/abixy-het
  296 run_mlr --seed 12345 bootstrap -n 20 $indir/abixy-het
  297 
  298 run_mlr --seed 12345 sample -k 2        $indir/abixy-het
  299 run_mlr --seed 12345 sample -k 2 -g a   $indir/abixy-het
  300 run_mlr --seed 12345 sample -k 2 -g a,b $indir/abixy-het
  301 
  302 run_mlr --seed 12345 shuffle $indir/abixy-het
  303 run_mlr --seed 23456 shuffle $indir/abixy-het
  304 run_mlr --seed 34567 shuffle $indir/abixy-het
  305 
  306 run_mlr uniq    -g a   $indir/abixy-het
  307 run_mlr uniq    -g a,b $indir/abixy-het
  308 
  309 run_mlr uniq    -f a   $indir/abixy-het
  310 run_mlr uniq    -f a,b $indir/abixy-het
  311 
  312 run_mlr uniq -c -g a   $indir/abixy-het
  313 run_mlr uniq -c -g a,b $indir/abixy-het
  314 
  315 run_mlr count-distinct -f a      $indir/small $indir/abixy
  316 run_mlr count-distinct -f a,b    $indir/small $indir/abixy
  317 run_mlr count-distinct -f a,b -u $indir/small $indir/abixy
  318 
  319 run_mlr count-distinct -f a   -n $indir/small $indir/abixy
  320 run_mlr count-distinct -f a,b -n $indir/small $indir/abixy
  321 
  322 run_mlr uniq    -g a   -o foo $indir/abixy-het
  323 run_mlr uniq    -g a,b -o foo $indir/abixy-het
  324 
  325 run_mlr uniq    -f a   -o foo $indir/abixy-het
  326 run_mlr uniq    -f a,b -o foo $indir/abixy-het
  327 
  328 run_mlr uniq -c -g a   -o foo $indir/abixy-het
  329 run_mlr uniq -c -g a,b -o foo $indir/abixy-het
  330 
  331 run_mlr uniq -a           $indir/repeats.dkvp
  332 run_mlr uniq -a -c        $indir/repeats.dkvp
  333 run_mlr uniq -a -c -o foo $indir/repeats.dkvp
  334 run_mlr uniq -a -n        $indir/repeats.dkvp
  335 run_mlr uniq -a -n -o bar $indir/repeats.dkvp
  336 
  337 run_mlr count-distinct -f a   -o foo $indir/small $indir/abixy
  338 run_mlr count-distinct -f a,b -o foo $indir/small $indir/abixy
  339 
  340 run_mlr count-distinct -f a   -n -o foo $indir/small $indir/abixy
  341 run_mlr count-distinct -f a,b -n -o foo $indir/small $indir/abixy
  342 
  343 run_mlr grep    pan $indir/abixy-het
  344 run_mlr grep -v pan $indir/abixy-het
  345 
  346 run_mlr decimate         -n 4 $indir/abixy
  347 run_mlr decimate      -b -n 4 $indir/abixy
  348 run_mlr decimate      -e -n 4 $indir/abixy
  349 run_mlr decimate -g a    -n 2 $indir/abixy
  350 run_mlr decimate -g a -b -n 2 $indir/abixy
  351 run_mlr decimate -g a -e -n 2 $indir/abixy
  352 
  353 # ----------------------------------------------------------------
  354 announce WHITESPACE-REDUCTION
  355 
  356 run_mlr --icsv --ojson cat                                $indir/clean-whitespace.csv
  357 run_mlr --icsv --ojson put '$a = lstrip($a)'              $indir/clean-whitespace.csv
  358 run_mlr --icsv --ojson put '$a = rstrip($a)'              $indir/clean-whitespace.csv
  359 run_mlr --icsv --ojson put '$a = strip($a)'               $indir/clean-whitespace.csv
  360 run_mlr --icsv --ojson put '$a = collapse_whitespace($a)' $indir/clean-whitespace.csv
  361 run_mlr --icsv --ojson put '$a = clean_whitespace($a)'    $indir/clean-whitespace.csv
  362 
  363 run_mlr --icsv --ojson clean-whitespace -k $indir/clean-whitespace.csv
  364 run_mlr --icsv --ojson clean-whitespace -v $indir/clean-whitespace.csv
  365 run_mlr --icsv --ojson clean-whitespace    $indir/clean-whitespace.csv
  366 
  367 # ----------------------------------------------------------------
  368 announce SORT
  369 
  370 run_mlr sort -f a   $indir/abixy
  371 run_mlr sort -r a   $indir/abixy
  372 run_mlr sort -f x   $indir/abixy
  373 run_mlr sort -r x   $indir/abixy
  374 run_mlr sort -nf x  $indir/abixy
  375 run_mlr sort -nr x  $indir/abixy
  376 
  377 run_mlr sort -f a,b   $indir/abixy
  378 run_mlr sort -r a,b   $indir/abixy
  379 run_mlr sort -f x,y   $indir/abixy
  380 run_mlr sort -r x,y   $indir/abixy
  381 run_mlr sort -nf x,y  $indir/abixy
  382 run_mlr sort -nr x,y  $indir/abixy
  383 
  384 run_mlr sort -f a -nr x $indir/abixy
  385 run_mlr sort -nr y -f a $indir/abixy
  386 run_mlr sort -f a -r b -nf x -nr y $indir/abixy
  387 
  388 run_mlr sort -f x $indir/sort-het.dkvp
  389 run_mlr sort -r x $indir/sort-het.dkvp
  390 
  391 # ----------------------------------------------------------------
  392 announce JOIN
  393 
  394 run_mlr --opprint join -s                -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
  395 run_mlr --opprint join                   -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
  396 
  397 run_mlr --opprint join -s      --ul      -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
  398 run_mlr --opprint join         --ul      -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
  399 
  400 run_mlr --opprint join -s           --ur -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
  401 run_mlr --opprint join              --ur -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
  402 
  403 run_mlr --opprint join -s --ul      --ur -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
  404 run_mlr --opprint join         --ul --ur -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
  405 
  406 run_mlr --opprint join -s --np --ul      -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
  407 run_mlr --opprint join    --np --ul      -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
  408 
  409 run_mlr --opprint join -s --np      --ur -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
  410 run_mlr --opprint join    --np      --ur -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
  411 
  412 run_mlr --opprint join -s --np --ul --ur -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
  413 run_mlr --opprint join    --np --ul --ur -f $indir/joina.dkvp -l l -r r -j o $indir/joinb.dkvp
  414 
  415 run_mlr join -l l -r r -j j -f $indir/joina.dkvp $indir/joinb.dkvp
  416 run_mlr join -l l      -j r -f $indir/joina.dkvp $indir/joinb.dkvp
  417 run_mlr join      -r r -j l -f $indir/joina.dkvp $indir/joinb.dkvp
  418 
  419 run_mlr --opprint join -s                -f /dev/null -l l -r r -j o $indir/joinb.dkvp
  420 run_mlr --opprint join                   -f /dev/null -l l -r r -j o $indir/joinb.dkvp
  421 
  422 run_mlr --opprint join -s      --ul      -f /dev/null -l l -r r -j o $indir/joinb.dkvp
  423 run_mlr --opprint join         --ul      -f /dev/null -l l -r r -j o $indir/joinb.dkvp
  424 
  425 run_mlr --opprint join -s           --ur -f /dev/null -l l -r r -j o $indir/joinb.dkvp
  426 run_mlr --opprint join              --ur -f /dev/null -l l -r r -j o $indir/joinb.dkvp
  427 
  428 run_mlr --opprint join -s      --ul --ur -f /dev/null -l l -r r -j o $indir/joinb.dkvp
  429 run_mlr --opprint join         --ul --ur -f /dev/null -l l -r r -j o $indir/joinb.dkvp
  430 
  431 run_mlr --opprint join -s --np --ul      -f /dev/null -l l -r r -j o $indir/joinb.dkvp
  432 run_mlr --opprint join    --np --ul      -f /dev/null -l l -r r -j o $indir/joinb.dkvp
  433 
  434 run_mlr --opprint join -s --np      --ur -f /dev/null -l l -r r -j o $indir/joinb.dkvp
  435 run_mlr --opprint join    --np      --ur -f /dev/null -l l -r r -j o $indir/joinb.dkvp
  436 
  437 run_mlr --opprint join -s --np --ul --ur -f /dev/null -l l -r r -j o $indir/joinb.dkvp
  438 run_mlr --opprint join    --np --ul --ur -f /dev/null -l l -r r -j o $indir/joinb.dkvp
  439 
  440 
  441 run_mlr --opprint join -s                -f $indir/joina.dkvp -l l -r r -j o /dev/null
  442 run_mlr --opprint join                   -f $indir/joina.dkvp -l l -r r -j o /dev/null
  443 
  444 run_mlr --opprint join -s      --ul      -f $indir/joina.dkvp -l l -r r -j o /dev/null
  445 run_mlr --opprint join         --ul      -f $indir/joina.dkvp -l l -r r -j o /dev/null
  446 
  447 run_mlr --opprint join -s           --ur -f $indir/joina.dkvp -l l -r r -j o /dev/null
  448 run_mlr --opprint join              --ur -f $indir/joina.dkvp -l l -r r -j o /dev/null
  449 
  450 run_mlr --opprint join -s      --ul --ur -f $indir/joina.dkvp -l l -r r -j o /dev/null
  451 run_mlr --opprint join         --ul --ur -f $indir/joina.dkvp -l l -r r -j o /dev/null
  452 
  453 run_mlr --opprint join -s --np --ul      -f $indir/joina.dkvp -l l -r r -j o /dev/null
  454 run_mlr --opprint join    --np --ul      -f $indir/joina.dkvp -l l -r r -j o /dev/null
  455 
  456 run_mlr --opprint join -s --np      --ur -f $indir/joina.dkvp -l l -r r -j o /dev/null
  457 run_mlr --opprint join    --np      --ur -f $indir/joina.dkvp -l l -r r -j o /dev/null
  458 
  459 run_mlr --opprint join -s --np --ul --ur -f $indir/joina.dkvp -l l -r r -j o /dev/null
  460 run_mlr --opprint join    --np --ul --ur -f $indir/joina.dkvp -l l -r r -j o /dev/null
  461 
  462 run_mlr --odkvp join -j a -f $indir/join-het.dkvp $indir/abixy-het
  463 run_mlr --odkvp join -j a -f $indir/abixy-het     $indir/join-het.dkvp
  464 run_mlr --odkvp join --np --ul --ur -j a -f $indir/join-het.dkvp $indir/abixy-het
  465 run_mlr --odkvp join --np --ul --ur -j a -f $indir/abixy-het     $indir/join-het.dkvp
  466 
  467 run_mlr --idkvp --oxtab join --lp left_ --rp right_ -j i -f $indir/abixy-het $indir/abixy-het
  468 
  469 for sorted_flag in "-s" ""; do
  470   for pairing_flags in "" "--np --ul" "--np --ur"; do
  471     for i in 1 2 3 4 5 6; do
  472       run_mlr join $sorted_flag $pairing_flags -l l -r r -j j -f $indir/het-join-left $indir/het-join-right-r$i
  473       for j in 1 2 3 4 5 6; do
  474         if [ "$i" -le "$j" ]; then
  475           run_mlr join $sorted_flag $pairing_flags -l l -r r -j j -f $indir/het-join-left $indir/het-join-right-r$i$j
  476         fi
  477       done
  478     done
  479   done
  480 done
  481 
  482 # ----------------------------------------------------------------
  483 announce JOIN PREPIPE
  484 
  485 run_mlr --prepipe cat --odkvp join -j a -f $indir/join-het.dkvp $indir/abixy-het
  486 run_mlr --odkvp join --prepipe cat -j a -f $indir/join-het.dkvp $indir/abixy-het
  487 run_mlr --prepipe cat --odkvp join --prepipe cat -j a -f $indir/join-het.dkvp $indir/abixy-het
  488 
  489 # ----------------------------------------------------------------
  490 announce JOIN MIXED-FORMAT
  491 
  492 # in1, in2, out all same formats
  493 run_mlr --json    join -s -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.json
  494 run_mlr --dkvp    join -s -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.dkvp
  495 run_mlr --csvlite join -s -j x -f $indir/multi-format-join-a.csv  $indir/multi-format-join-b.csv
  496 
  497 run_mlr --json    join -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.json
  498 run_mlr --dkvp    join -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.dkvp
  499 run_mlr --csvlite join -j x -f $indir/multi-format-join-a.csv  $indir/multi-format-join-b.csv
  500 
  501 # in2 different format
  502 run_mlr --json    join -s -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.json
  503 run_mlr --dkvp    join -s -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.dkvp
  504 run_mlr --csvlite join -s -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.csv
  505 
  506 run_mlr --json    join    -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.json
  507 run_mlr --dkvp    join    -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.dkvp
  508 run_mlr --csvlite join    -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.csv
  509 
  510 run_mlr --json    join -s -i dkvp  -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.json
  511 run_mlr --dkvp    join -s -i dkvp  -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.dkvp
  512 run_mlr --csvlite join -s -i dkvp  -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.csv
  513 
  514 run_mlr --json    join    -i dkvp  -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.json
  515 run_mlr --dkvp    join    -i dkvp  -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.dkvp
  516 run_mlr --csvlite join    -i dkvp  -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.csv
  517 
  518 run_mlr --json    join -s -i json  -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.json
  519 run_mlr --dkvp    join -s -i json  -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.dkvp
  520 run_mlr --csvlite join -s -i json  -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.csv
  521 
  522 run_mlr --json    join    -i json  -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.json
  523 run_mlr --dkvp    join    -i json  -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.dkvp
  524 run_mlr --csvlite join    -i json  -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.csv
  525 
  526 # vary all three
  527 run_mlr --ijson    --ojson join -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.json
  528 run_mlr --idkvp    --ojson join -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.dkvp
  529 run_mlr --icsvlite --ojson join -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.csv
  530 
  531 run_mlr --ijson    --ojson join -i dkvp     -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.json
  532 run_mlr --idkvp    --ojson join -i dkvp     -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.dkvp
  533 run_mlr --icsvlite --ojson join -i dkvp     -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.csv
  534 
  535 run_mlr --ijson    --ojson join -i json     -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.json
  536 run_mlr --idkvp    --ojson join -i json     -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.dkvp
  537 run_mlr --icsvlite --ojson join -i json     -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.csv
  538 
  539 
  540 run_mlr --ijson    --odkvp join -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.json
  541 run_mlr --idkvp    --odkvp join -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.dkvp
  542 run_mlr --icsvlite --odkvp join -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.csv
  543 
  544 run_mlr --ijson    --odkvp join -i dkvp     -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.json
  545 run_mlr --idkvp    --odkvp join -i dkvp     -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.dkvp
  546 run_mlr --icsvlite --odkvp join -i dkvp     -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.csv
  547 
  548 run_mlr --ijson    --odkvp join -i json     -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.json
  549 run_mlr --idkvp    --odkvp join -i json     -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.dkvp
  550 run_mlr --icsvlite --odkvp join -i json     -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.csv
  551 
  552 
  553 run_mlr --ijson    --ocsvlite join -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.json
  554 run_mlr --idkvp    --ocsvlite join -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.dkvp
  555 run_mlr --icsvlite --ocsvlite join -i csvlite -j x -f $indir/multi-format-join-a.csv $indir/multi-format-join-b.csv
  556 
  557 run_mlr --ijson    --ocsvlite join -i dkvp     -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.json
  558 run_mlr --idkvp    --ocsvlite join -i dkvp     -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.dkvp
  559 run_mlr --icsvlite --ocsvlite join -i dkvp     -j x -f $indir/multi-format-join-a.dkvp $indir/multi-format-join-b.csv
  560 
  561 run_mlr --ijson    --ocsvlite join -i json     -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.json
  562 run_mlr --idkvp    --ocsvlite join -i json     -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.dkvp
  563 run_mlr --icsvlite --ocsvlite join -i json     -j x -f $indir/multi-format-join-a.json $indir/multi-format-join-b.csv
  564 
  565 # ----------------------------------------------------------------
  566 announce REPEAT
  567 
  568 run_mlr repeat -n 5 $indir/repeat-input.dat
  569 run_mlr repeat -f a $indir/repeat-input.dat
  570 run_mlr repeat -f b $indir/repeat-input.dat
  571 run_mlr repeat -f c $indir/repeat-input.dat
  572 
  573 # ----------------------------------------------------------------
  574 announce RESHAPE
  575 
  576 run_mlr --pprint reshape -i X,Y,Z   -o item,price $indir/reshape-wide.tbl
  577 run_mlr --pprint reshape -i X,Z     -o item,price $indir/reshape-wide.tbl
  578 run_mlr --pprint reshape -r '[X-Z]' -o item,price $indir/reshape-wide.tbl
  579 run_mlr --pprint reshape -r '[XZ]'  -o item,price $indir/reshape-wide.tbl
  580 
  581 run_mlr --pprint reshape -s item,price $indir/reshape-long.tbl
  582 
  583 run_mlr --pprint reshape -i X,Y,Z -o item,price then reshape -s item,price $indir/reshape-wide.tbl
  584 run_mlr --pprint reshape -s item,price then reshape -i X,Y,Z -o item,price $indir/reshape-long.tbl
  585 
  586 run_mlr reshape -i X,Y,Z   -o item,price $indir/reshape-wide-ragged.dkvp
  587 run_mlr reshape -i X,Z     -o item,price $indir/reshape-wide-ragged.dkvp
  588 run_mlr reshape -r '[X-Z]' -o item,price $indir/reshape-wide-ragged.dkvp
  589 run_mlr reshape -r '[XZ]'  -o item,price $indir/reshape-wide-ragged.dkvp
  590 
  591 run_mlr reshape -s item,price $indir/reshape-long-ragged.dkvp
  592 
  593 run_mlr --json reshape -i x,y -o item,value $indir/small-non-nested.json
  594 
  595 # ----------------------------------------------------------------
  596 announce NEST
  597 
  598 run_mlr cat $indir/nest-explode.dkvp
  599 run_mlr cat $indir/nest-explode-vary-fs-ps.dkvp
  600 
  601 run_mlr nest --explode --values --across-fields  -f x $indir/nest-explode.dkvp
  602 run_mlr nest --explode --values --across-fields  -f x --nested-fs pipe --nested-ps = $indir/nest-explode-vary-fs-ps.dkvp
  603 
  604 run_mlr nest --explode --values --across-fields  -f x then nest --implode --values --across-fields  -f x $indir/nest-explode.dkvp
  605 run_mlr nest --explode --values --across-fields  -f x --nested-fs pipe --nested-ps = then nest --implode --values --across-fields  -f x --nested-fs pipe --nested-ps = $indir/nest-explode-vary-fs-ps.dkvp
  606 
  607 run_mlr nest --explode --values --across-records -f x $indir/nest-explode.dkvp
  608 run_mlr nest --explode --values --across-records -f x --nested-fs pipe --nested-ps = $indir/nest-explode-vary-fs-ps.dkvp
  609 
  610 run_mlr nest --explode --values --across-records -f x then nest --implode --values --across-records -f x $indir/nest-explode.dkvp
  611 run_mlr nest --explode --values --across-records -f x --nested-fs pipe --nested-ps = then nest --implode --values --across-records -f x --nested-fs pipe --nested-ps = $indir/nest-explode-vary-fs-ps.dkvp
  612 
  613 run_mlr nest --explode --pairs  --across-fields  -f x $indir/nest-explode.dkvp
  614 run_mlr nest --explode --pairs  --across-fields  -f x --nested-fs pipe --nested-ps = $indir/nest-explode-vary-fs-ps.dkvp
  615 
  616 run_mlr nest --explode --pairs  --across-records -f x $indir/nest-explode.dkvp
  617 run_mlr nest --explode --pairs  --across-records -f x --nested-fs pipe --nested-ps = $indir/nest-explode-vary-fs-ps.dkvp
  618 
  619 # ----------------------------------------------------------------
  620 announce FILL-DOWN
  621 
  622 run_mlr --csv fill-down -f a,b,c    $indir/fill-down.csv
  623 run_mlr --csv fill-down -f a,b,c -a $indir/fill-down.csv
  624 
  625 # ----------------------------------------------------------------
  626 announce SEQGEN
  627 
  628 run_mlr seqgen --start 1 --stop 5 --step  1
  629 run_mlr seqgen --start 1 --stop 5 --step  2
  630 run_mlr seqgen --start 1 --stop 1 --step  1 -f a
  631 run_mlr seqgen --start 5 --stop 1 --step  1 -f b
  632 run_mlr seqgen --start 5 --stop 1 --step -1 -f c
  633 run_mlr seqgen --start 5 --stop 5 --step -1 -f d
  634 run_mlr --from $indir/abixy cat then seqgen --start 1 --stop 5
  635 run_mlr --from $indir/abixy cat then seqgen --start 1 --stop 100 then stats1 -a count,sum,min,p50,max -f i
  636 
  637 # ----------------------------------------------------------------
  638 announce FRACTION
  639 
  640 run_mlr fraction -f x,y              $indir/abixy-het
  641 run_mlr fraction -f x,y -g a         $indir/abixy-het
  642 run_mlr fraction -f x,y -g a,b       $indir/abixy-het
  643 
  644 run_mlr fraction -f x,y        -p    $indir/abixy-het
  645 run_mlr fraction -f x,y -g a   -p    $indir/abixy-het
  646 run_mlr fraction -f x,y -g a,b -p    $indir/abixy-het
  647 
  648 run_mlr fraction -f x,y           -c $indir/abixy-het
  649 run_mlr fraction -f x,y -g a      -c $indir/abixy-het
  650 run_mlr fraction -f x,y -g a,b    -c $indir/abixy-het
  651 
  652 run_mlr fraction -f x,y        -p -c $indir/abixy-het
  653 run_mlr fraction -f x,y -g a   -p -c $indir/abixy-het
  654 run_mlr fraction -f x,y -g a,b -p -c $indir/abixy-het
  655 
  656 # ----------------------------------------------------------------
  657 announce STATS
  658 
  659 run_mlr --opprint stats1    -a mean,sum,count,min,max,antimode,mode     -f i,x,y $indir/abixy
  660 run_mlr --opprint stats1    -a min,p10,p50,median,antimode,mode,p90,max -f i,x,y $indir/abixy
  661 run_mlr --opprint stats1    -a mean,meaneb,stddev                       -f i,x,y $indir/abixy
  662 run_mlr --oxtab   stats1 -s -a mean,sum,count,min,max,antimode,mode     -f i,x,y $indir/abixy
  663 
  664 run_mlr --opprint stats1    -a mean,sum,count,min,max,antimode,mode     -f i,x,y -g a $indir/abixy
  665 run_mlr --opprint stats1    -a min,p10,p50,median,antimode,mode,p90,max -f i,x,y -g a $indir/abixy
  666 run_mlr --opprint stats1    -a mean,meaneb,stddev                       -f i,x,y -g a $indir/abixy
  667 run_mlr --oxtab   stats1 -s -a mean,sum,count,min,max,antimode,mode     -f i,x,y -g a $indir/abixy
  668 
  669 run_mlr --opprint stats1    -a mean,sum,count,min,max,antimode,mode     -f i,x,y -g a,b $indir/abixy
  670 run_mlr --opprint stats1    -a min,p10,p50,median,antimode,mode,p90,max -f i,x,y -g a,b $indir/abixy
  671 run_mlr --opprint stats1    -a mean,meaneb,stddev                       -f i,x,y -g a,b $indir/abixy
  672 run_mlr --oxtab   stats1 -s -a mean,sum,count,min,max,antimode,mode     -f i,x,y -g a,b $indir/abixy
  673 
  674 run_mlr --oxtab stats1 -a min,p0,p50,p100,max -f x,y,z $indir/string-numeric-ordering.dkvp
  675 
  676 run_mlr --oxtab   stats1 -a mean -f x      $indir/abixy-het
  677 run_mlr --oxtab   stats1 -a mean -f x -g a $indir/abixy-het
  678 
  679 run_mlr --oxtab   stats1 -a p0,p50,p100 -f x,y    $indir/near-ovf.dkvp
  680 run_mlr --oxtab   stats1 -a p0,p50,p100 -f x,y -F $indir/near-ovf.dkvp
  681 
  682 run_mlr --opprint stats2       -a linreg-ols,linreg-pca,r2,corr,cov -f x,y,xy,y2        $indir/abixy-wide
  683 run_mlr --opprint stats2       -a linreg-ols,linreg-pca,r2,corr,cov -f x,y,xy,y2 -g a,b $indir/abixy-wide
  684 run_mlr --oxtab   stats2 -s    -a linreg-ols,linreg-pca,r2,corr,cov -f x,y,xy,y2        $indir/abixy-wide-short
  685 run_mlr --oxtab   stats2 -s    -a linreg-ols,linreg-pca,r2,corr,cov -f x,y,xy,y2 -g a,b $indir/abixy-wide-short
  686 run_mlr --opprint stats2 --fit -a linreg-ols,linreg-pca             -f x,y,xy,y2        $indir/abixy-wide-short
  687 run_mlr --opprint stats2 --fit -a linreg-ols,linreg-pca             -f x,y,xy,y2 -g a   $indir/abixy-wide-short
  688 
  689 run_mlr --opprint stats2    -a logireg -f x,y      $indir/logi.dkvp
  690 run_mlr --opprint stats2    -a logireg -f x,y -g g $indir/logi.dkvp
  691 
  692 run_mlr --oxtab   stats2 -a cov -f x,y      $indir/abixy-het
  693 run_mlr --oxtab   stats2 -a cov -f x,y -g a $indir/abixy-het
  694 
  695 run_mlr --opprint step -a rsum,shift,delta,counter -f x,y $indir/abixy
  696 run_mlr --opprint step -a rsum,shift,delta,counter -f x,y -g a $indir/abixy
  697 run_mlr --opprint step -a ewma -d 0.1,0.9 -f x,y -g a $indir/abixy
  698 run_mlr --opprint step -a ewma -d 0.1,0.9 -o smooth,rough -f x,y -g a $indir/abixy
  699 
  700 run_mlr --odkvp   step -a rsum,shift,delta,counter -f x,y      $indir/abixy-het
  701 run_mlr --odkvp   step -a rsum,shift,delta,counter -f x,y -g a $indir/abixy-het
  702 run_mlr --opprint step -a ewma -d 0.1,0.9 -f x,y -g a $indir/abixy-het
  703 run_mlr --opprint step -a ewma -d 0.1,0.9 -o smooth,rough -f x,y -g a $indir/abixy-het
  704 
  705 run_mlr --icsvlite --opprint step -a from-first -f x      $indir/from-first.csv
  706 run_mlr --icsvlite --opprint step -a from-first -f x -g g $indir/from-first.csv
  707 
  708 run_mlr --opprint histogram -f x,y --lo 0 --hi 1 --nbins 20 $indir/small
  709 run_mlr --opprint histogram -f x,y --lo 0 --hi 1 --nbins 20 -o foo_ $indir/small
  710 
  711 run_mlr --opprint histogram --nbins 9 --auto -f x,y $indir/ints.dkvp
  712 run_mlr --opprint histogram --nbins 9 --auto -f x,y -o foo_ $indir/ints.dkvp
  713 
  714 run_mlr --csvlite --opprint merge-fields    -a p0,min,p29,max,p100,sum -c _in,_out $indir/merge-fields-in-out.csv
  715 run_mlr --csvlite --opprint merge-fields -k -a p0,min,p29,max,p100,sum -c _in,_out $indir/merge-fields-in-out.csv
  716 
  717 run_mlr --csvlite --opprint merge-fields -i    -a p0,min,p29,max,p100,sum -c _in,_out $indir/merge-fields-in-out.csv
  718 run_mlr --csvlite --opprint merge-fields -i -k -a p0,min,p29,max,p100,sum -c _in,_out $indir/merge-fields-in-out.csv
  719 
  720 run_mlr --csvlite --opprint merge-fields    -a p0,min,p29,max,p100 -c _in,_out $indir/merge-fields-in-out-mixed.csv
  721 run_mlr --csvlite --opprint merge-fields -k -a p0,min,p29,max,p100 -c _in,_out $indir/merge-fields-in-out-mixed.csv
  722 
  723 run_mlr --oxtab merge-fields -k -a p0,min,p29,max,p100,sum,count -f a_in_x,a_out_x -o foo $indir/merge-fields-abxy.dkvp
  724 run_mlr --oxtab merge-fields -k -a p0,min,p29,max,p100,sum,count -r in_,out_       -o bar $indir/merge-fields-abxy.dkvp
  725 run_mlr --oxtab merge-fields -k -a p0,min,p29,max,p100,sum,count -c in_,out_              $indir/merge-fields-abxy.dkvp
  726 
  727 run_mlr --oxtab merge-fields -i -k -a p0,min,p29,max,p100,sum,count -f a_in_x,a_out_x -o foo $indir/merge-fields-abxy.dkvp
  728 run_mlr --oxtab merge-fields -i -k -a p0,min,p29,max,p100,sum,count -r in_,out_       -o bar $indir/merge-fields-abxy.dkvp
  729 run_mlr --oxtab merge-fields -i -k -a p0,min,p29,max,p100,sum,count -c in_,out_              $indir/merge-fields-abxy.dkvp
  730 
  731 # ----------------------------------------------------------------
  732 announce STATS1 WITH REGEXED FIELD NAMES
  733 
  734 run_mlr --from $indir/abixy --opprint stats1 -a sum  -g  a,b      -f  i,x,y
  735 
  736 run_mlr --from $indir/abixy --opprint stats1 -a sum --gr '^[a-h]$' --fr '^[i-z]$'
  737 run_mlr --from $indir/abixy --opprint stats1 -a sum  -g  a,b       --fr '^[i-z]$'
  738 run_mlr --from $indir/abixy --opprint stats1 -a sum --gr '^[a-h]$'  -f  i,x,y
  739 
  740 run_mlr --from $indir/abixy --opprint stats1 -a sum --gx '^[i-z]$' --fx '^[a-h]$'
  741 run_mlr --from $indir/abixy --opprint stats1 -a sum  -g  a,b       --fx '^[a-h]$'
  742 run_mlr --from $indir/abixy --opprint stats1 -a sum --gx '^[i-z]$'  -f  i,x,y
  743 
  744 # ----------------------------------------------------------------
  745 announce MOST/LEAST FREQUENT
  746 
  747 run_mlr --opprint --from $indir/freq.dkvp most-frequent -f a -n 3
  748 run_mlr --opprint --from $indir/freq.dkvp most-frequent -f a,b -n 3
  749 run_mlr --opprint --from $indir/freq.dkvp most-frequent -f a,b -n 3 -b
  750 run_mlr --opprint --from $indir/freq.dkvp most-frequent -f nonesuch -n 3
  751 
  752 run_mlr --opprint --from $indir/freq.dkvp least-frequent -f a -n 3
  753 run_mlr --opprint --from $indir/freq.dkvp least-frequent -f a,b -n 3
  754 run_mlr --opprint --from $indir/freq.dkvp least-frequent -f a,b -n 3 -b
  755 run_mlr --opprint --from $indir/freq.dkvp least-frequent -f nonesuch -n 3
  756 
  757 run_mlr --opprint --from $indir/freq.dkvp most-frequent -f a -n 3 -o foo
  758 run_mlr --opprint --from $indir/freq.dkvp most-frequent -f a,b -n 3 -o foo
  759 run_mlr --opprint --from $indir/freq.dkvp most-frequent -f a,b -n 3 -b -o foo
  760 run_mlr --opprint --from $indir/freq.dkvp most-frequent -f nonesuch -n 3 -o foo
  761 
  762 run_mlr --opprint --from $indir/freq.dkvp least-frequent -f a -n 3 -o foo
  763 run_mlr --opprint --from $indir/freq.dkvp least-frequent -f a,b -n 3 -o foo
  764 run_mlr --opprint --from $indir/freq.dkvp least-frequent -f a,b -n 3 -b -o foo
  765 run_mlr --opprint --from $indir/freq.dkvp least-frequent -f nonesuch -n 3 -o foo
  766 
  767 # ----------------------------------------------------------------
  768 announce COUNT-SIMILAR
  769 
  770 run_mlr --opprint --from $indir/abixy count-similar -g a
  771 run_mlr --opprint --from $indir/abixy count-similar -g b,i
  772 run_mlr --opprint --from $indir/abixy count-similar -g a,b,i -o other_name_for_counter
  773 
  774 # ----------------------------------------------------------------
  775 announce NON-INTERPOLATED AND INTERPOLATED PERCENTILES
  776 
  777 for k in 1 2 3 4 5 6 7 8 9 10 11; do
  778 run_mlr --from $indir/x0to10.dat --oxtab head -n $k then stats1 -f x -a p00,p01,p02,p03,p04,p05,p06,p07,p08,p09,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19,p20,p21,p22,p23,p24,p25,p26,p27,p28,p29,p30,p31,p32,p33,p34,p35,p36,p37,p38,p39,p40,p41,p42,p43,p44,p45,p46,p47,p48,p49,p50,p51,p52,p53,p54,p55,p56,p57,p58,p59,p60,p61,p62,p63,p64,p65,p66,p67,p68,p69,p70,p71,p72,p73,p74,p75,p76,p77,p78,p79,p80,p81,p82,p83,p84,p85,p86,p87,p88,p89,p90,p91,p92,p93,p94,p95,p96,p97,p98,p99,p100
  779 done
  780 
  781 for k in 1 2 3 4 5 6 7 8 9 10 11; do
  782 run_mlr --from $indir/x0to10.dat --oxtab head -n $k then stats1 -i -f x -a p00,p01,p02,p03,p04,p05,p06,p07,p08,p09,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19,p20,p21,p22,p23,p24,p25,p26,p27,p28,p29,p30,p31,p32,p33,p34,p35,p36,p37,p38,p39,p40,p41,p42,p43,p44,p45,p46,p47,p48,p49,p50,p51,p52,p53,p54,p55,p56,p57,p58,p59,p60,p61,p62,p63,p64,p65,p66,p67,p68,p69,p70,p71,p72,p73,p74,p75,p76,p77,p78,p79,p80,p81,p82,p83,p84,p85,p86,p87,p88,p89,p90,p91,p92,p93,p94,p95,p96,p97,p98,p99,p100
  783 done
  784 
  785 # ----------------------------------------------------------------
  786 announce DSL OPERATOR ASSOCIATIVITY
  787 # Note: filter -v and put -v print the AST.
  788 
  789 run_mlr put    -v '$x = 1 || 2 || 3'   /dev/null
  790 run_mlr filter -v '     1 || 2 || 3'   /dev/null
  791 run_mlr put    -v '$x = 1 ^^ 2 ^^ 3'   /dev/null
  792 run_mlr filter -v '     1 ^^ 2 ^^ 3'   /dev/null
  793 run_mlr put    -v '$x = 1 && 2 && 3'   /dev/null
  794 run_mlr filter -v '     1 && 2 && 3'   /dev/null
  795 
  796 run_mlr put    -v '$x = 1  == 2  == 3' /dev/null
  797 run_mlr filter -v '     1  == 2  == 3' /dev/null
  798 run_mlr put    -v '$x = 1  != 2  != 3' /dev/null
  799 run_mlr filter -v '     1  != 2  != 3' /dev/null
  800 run_mlr put    -v '$x = 1  =~ 2  =~ 3' /dev/null
  801 run_mlr filter -v '     1  =~ 2  =~ 3' /dev/null
  802 run_mlr put    -v '$x = 1 !=~ 2 !=~ 3' /dev/null
  803 run_mlr filter -v '     1 !=~ 2 !=~ 3' /dev/null
  804 run_mlr put    -v '$x = 1  == 2  != 3' /dev/null
  805 run_mlr filter -v '     1  == 2  != 3' /dev/null
  806 run_mlr put    -v '$x = 1  != 2  == 3' /dev/null
  807 run_mlr filter -v '     1  != 2  == 3' /dev/null
  808 
  809 run_mlr put    -v '$x = 1  <  2  <  3' /dev/null
  810 run_mlr filter -v '     1  <  2  <  3' /dev/null
  811 run_mlr put    -v '$x = 1  <= 2  <= 3' /dev/null
  812 run_mlr filter -v '     1  <= 2  <= 3' /dev/null
  813 run_mlr put    -v '$x = 1  >  2  >  3' /dev/null
  814 run_mlr filter -v '     1  >  2  >  3' /dev/null
  815 run_mlr put    -v '$x = 1  >= 2  >= 3' /dev/null
  816 run_mlr filter -v '     1  >= 2  >= 3' /dev/null
  817 run_mlr put    -v '$x = 1  <  2  <= 3' /dev/null
  818 run_mlr filter -v '     1  <  2  <= 3' /dev/null
  819 run_mlr put    -v '$x = 1  <= 2  <  3' /dev/null
  820 run_mlr filter -v '     1  <= 2  <  3' /dev/null
  821 
  822 run_mlr put    -v '$x = 1 |  2 |  3'   /dev/null
  823 run_mlr filter -v '     1 |  2 |  3'   /dev/null
  824 run_mlr put    -v '$x = 1 ^  2 ^  3'   /dev/null
  825 run_mlr filter -v '     1 ^  2 ^  3'   /dev/null
  826 run_mlr put    -v '$x = 1 &  2 &  3'   /dev/null
  827 run_mlr filter -v '     1 &  2 &  3'   /dev/null
  828 run_mlr put    -v '$x = 1 |  2 &  3'   /dev/null
  829 run_mlr filter -v '     1 |  2 &  3'   /dev/null
  830 run_mlr put    -v '$x = 1 |  2 ^  3'   /dev/null
  831 run_mlr filter -v '     1 |  2 ^  3'   /dev/null
  832 run_mlr put    -v '$x = 1 ^  2 |  3'   /dev/null
  833 run_mlr filter -v '     1 ^  2 |  3'   /dev/null
  834 run_mlr put    -v '$x = 1 ^  2 &  3'   /dev/null
  835 run_mlr filter -v '     1 ^  2 &  3'   /dev/null
  836 run_mlr put    -v '$x = 1 &  2 |  3'   /dev/null
  837 run_mlr filter -v '     1 &  2 |  3'   /dev/null
  838 run_mlr put    -v '$x = 1 &  2 ^  3'   /dev/null
  839 run_mlr filter -v '     1 &  2 ^  3'   /dev/null
  840 
  841 run_mlr put    -v '$x = 1  << 2  << 3' /dev/null
  842 run_mlr filter -v '     1  << 2  << 3' /dev/null
  843 run_mlr put    -v '$x = 1  >> 2  >> 3' /dev/null
  844 run_mlr filter -v '     1  >> 2  >> 3' /dev/null
  845 run_mlr put    -v '$x = 1  << 2  >> 3' /dev/null
  846 run_mlr filter -v '     1  << 2  >> 3' /dev/null
  847 run_mlr put    -v '$x = 1  >> 2  << 3' /dev/null
  848 run_mlr filter -v '     1  >> 2  << 3' /dev/null
  849 
  850 run_mlr put    -v '$x = 1 + 2 + 3'   /dev/null
  851 run_mlr filter -v '     1 + 2 + 3'   /dev/null
  852 run_mlr put    -v '$x = 1 - 2 - 3'   /dev/null
  853 run_mlr filter -v '     1 - 2 - 3'   /dev/null
  854 run_mlr put    -v '$x = 1 + 2 - 3'   /dev/null
  855 run_mlr filter -v '     1 + 2 - 3'   /dev/null
  856 run_mlr put    -v '$x = 1 - 2 + 3'   /dev/null
  857 run_mlr filter -v '     1 - 2 + 3'   /dev/null
  858 run_mlr put    -v '$x = 1 . 2 . 3'   /dev/null
  859 run_mlr filter -v '     1 . 2 . 3'   /dev/null
  860 
  861 run_mlr put    -v '$x = 1 * 2 * 3'   /dev/null
  862 run_mlr filter -v '     1 * 2 * 3'   /dev/null
  863 run_mlr put    -v '$x = 1 / 2 / 3'   /dev/null
  864 run_mlr filter -v '     1 / 2 / 3'   /dev/null
  865 run_mlr put    -v '$x = 1 // 2 // 3' /dev/null
  866 run_mlr filter -v '     1 // 2 // 3' /dev/null
  867 run_mlr put    -v '$x = 1 % 2 % 3'   /dev/null
  868 run_mlr filter -v '     1 % 2 % 3'   /dev/null
  869 run_mlr put    -v '$x = 1 ** 2 ** 3' /dev/null
  870 run_mlr filter -v '     1 ** 2 ** 3' /dev/null
  871 
  872 
  873 run_mlr put    -v '$x = 1 *  2 /  3'   /dev/null
  874 run_mlr filter -v '     1 *  2 /  3'   /dev/null
  875 run_mlr put    -v '$x = 1 *  2 // 3'   /dev/null
  876 run_mlr filter -v '     1 *  2 // 3'   /dev/null
  877 run_mlr put    -v '$x = 1 *  2 %  3'   /dev/null
  878 run_mlr filter -v '     1 *  2 %  3'   /dev/null
  879 run_mlr put    -v '$x = 1 *  2 ** 3'   /dev/null
  880 run_mlr filter -v '     1 *  2 ** 3'   /dev/null
  881 
  882 run_mlr put    -v '$x = 1 /  2 *  3'   /dev/null
  883 run_mlr filter -v '     1 /  2 *  3'   /dev/null
  884 run_mlr put    -v '$x = 1 /  2 // 3'   /dev/null
  885 run_mlr filter -v '     1 /  2 // 3'   /dev/null
  886 run_mlr put    -v '$x = 1 /  2 %  3'   /dev/null
  887 run_mlr filter -v '     1 /  2 %  3'   /dev/null
  888 run_mlr put    -v '$x = 1 /  2 ** 3'   /dev/null
  889 run_mlr filter -v '     1 /  2 ** 3'   /dev/null
  890 
  891 run_mlr put    -v '$x = 1 // 2 *  3'   /dev/null
  892 run_mlr filter -v '     1 // 2 *  3'   /dev/null
  893 run_mlr put    -v '$x = 1 // 2 /  3'   /dev/null
  894 run_mlr filter -v '     1 // 2 /  3'   /dev/null
  895 run_mlr put    -v '$x = 1 // 2 %  3'   /dev/null
  896 run_mlr filter -v '     1 // 2 %  3'   /dev/null
  897 run_mlr put    -v '$x = 1 // 2 ** 3'   /dev/null
  898 run_mlr filter -v '     1 // 2 ** 3'   /dev/null
  899 
  900 run_mlr put    -v '$x = 1 %  2 *  3'   /dev/null
  901 run_mlr filter -v '     1 %  2 *  3'   /dev/null
  902 run_mlr put    -v '$x = 1 %  2 /  3'   /dev/null
  903 run_mlr filter -v '     1 %  2 /  3'   /dev/null
  904 run_mlr put    -v '$x = 1 %  2 // 3'   /dev/null
  905 run_mlr filter -v '     1 %  2 // 3'   /dev/null
  906 run_mlr put    -v '$x = 1 %  2 ** 3'   /dev/null
  907 run_mlr filter -v '     1 %  2 ** 3'   /dev/null
  908 
  909 run_mlr put    -v '$x = 1 ** 2 *  3'   /dev/null
  910 run_mlr filter -v '     1 ** 2 *  3'   /dev/null
  911 run_mlr put    -v '$x = 1 ** 2 /  3'   /dev/null
  912 run_mlr filter -v '     1 ** 2 /  3'   /dev/null
  913 run_mlr put    -v '$x = 1 ** 2 // 3'   /dev/null
  914 run_mlr filter -v '     1 ** 2 // 3'   /dev/null
  915 run_mlr put    -v '$x = 1 ** 2 %  3'   /dev/null
  916 run_mlr filter -v '     1 ** 2 %  3'   /dev/null
  917 
  918 run_mlr put    -v '$x = ++1'   /dev/null
  919 run_mlr filter -v '     ++1'   /dev/null
  920 run_mlr put    -v '$x = --1'   /dev/null
  921 run_mlr filter -v '     --1'   /dev/null
  922 run_mlr put    -v '$x = !!1'   /dev/null
  923 run_mlr filter -v '     !!1'   /dev/null
  924 run_mlr put    -v '$x = ~~1'   /dev/null
  925 run_mlr filter -v '     ~~1'   /dev/null
  926 
  927 run_mlr put    -v '$x = 1 ? 2 : 3'         /dev/null
  928 run_mlr filter -v '     1 ? 2 : 3'         /dev/null
  929 run_mlr put    -v '$x = 1 ? 2 ? 3 : 4 : 5' /dev/null
  930 run_mlr filter -v '     1 ? 2 ? 3 : 4 : 5' /dev/null
  931 run_mlr put    -v '$x = 1 ? 2 : 3 ? 4 : 5' /dev/null
  932 run_mlr filter -v '     1 ? 2 : 3 ? 4 : 5' /dev/null
  933 
  934 # ----------------------------------------------------------------
  935 announce DSL OPERATOR PRECEDENCE
  936 # Note: filter -v and put -v print the AST.
  937 
  938 run_mlr put    -v '$x = 1 || 2 ^^ 3'   /dev/null
  939 run_mlr filter -v '     1 || 2 ^^ 3'   /dev/null
  940 run_mlr put    -v '$x = 1 || 2 && 3'   /dev/null
  941 run_mlr filter -v '     1 || 2 && 3'   /dev/null
  942 
  943 run_mlr put    -v '$x = 1 ^^ 2 || 3'   /dev/null
  944 run_mlr filter -v '     1 ^^ 2 || 3'   /dev/null
  945 run_mlr put    -v '$x = 1 ^^ 2 && 3'   /dev/null
  946 run_mlr filter -v '     1 ^^ 2 && 3'   /dev/null
  947 
  948 run_mlr put    -v '$x = 1 && 2 || 3'   /dev/null
  949 run_mlr filter -v '     1 && 2 || 3'   /dev/null
  950 run_mlr put    -v '$x = 1 && 2 ^^ 3'   /dev/null
  951 run_mlr filter -v '     1 && 2 ^^ 3'   /dev/null
  952 
  953 run_mlr put    -v '$x =  1 == 2 <= 3'  /dev/null
  954 run_mlr filter -v '      1 == 2 <= 3'  /dev/null
  955 run_mlr put    -v '$x =  1 <= 2 == 3'  /dev/null
  956 run_mlr filter -v '      1 <= 2 == 3'  /dev/null
  957 
  958 run_mlr put    -v '$x =  1 <= 2 |  3'  /dev/null
  959 run_mlr filter -v '      1 <= 2 |  3'  /dev/null
  960 run_mlr put    -v '$x =  1 |  2 <= 3'  /dev/null
  961 run_mlr filter -v '      1 |  2 <= 3'  /dev/null
  962 
  963 run_mlr put    -v '$x =  1 |  2 ^  3'  /dev/null
  964 run_mlr filter -v '      1 |  2 ^  3'  /dev/null
  965 run_mlr put    -v '$x =  1 ^  2 |  3'  /dev/null
  966 run_mlr filter -v '      1 ^  2 |  3'  /dev/null
  967 
  968 run_mlr put    -v '$x =  1 ^  2 &  3'  /dev/null
  969 run_mlr filter -v '      1 ^  2 &  3'  /dev/null
  970 run_mlr put    -v '$x =  1 &  2 ^  3'  /dev/null
  971 run_mlr filter -v '      1 &  2 ^  3'  /dev/null
  972 
  973 run_mlr put    -v '$x =  1 &  2 << 3'  /dev/null
  974 run_mlr filter -v '      1 &  2 << 3'  /dev/null
  975 run_mlr put    -v '$x =  1 << 2 &  3'  /dev/null
  976 run_mlr filter -v '      1 << 2 &  3'  /dev/null
  977 
  978 run_mlr put    -v '$x =  1 +  2 * 3'   /dev/null
  979 run_mlr filter -v '      1 +  2 * 3'   /dev/null
  980 run_mlr put    -v '$x =  1 *  2 + 3'   /dev/null
  981 run_mlr filter -v '      1 *  2 + 3'   /dev/null
  982 run_mlr put    -v '$x =  1 + (2 * 3)'  /dev/null
  983 run_mlr filter -v '      1 + (2 * 3)'  /dev/null
  984 run_mlr put    -v '$x =  1 * (2 + 3)'  /dev/null
  985 run_mlr filter -v '      1 * (2 + 3)'  /dev/null
  986 run_mlr put    -v '$x = (1 + 2) * 3'   /dev/null
  987 run_mlr filter -v '     (1 + 2) * 3'   /dev/null
  988 run_mlr put    -v '$x = (1 * 2) + 3'   /dev/null
  989 run_mlr filter -v '     (1 * 2) + 3'   /dev/null
  990 
  991 run_mlr put    -v '$x =  1 +   2 ** 3'  /dev/null
  992 run_mlr filter -v '      1 +   2 ** 3'  /dev/null
  993 run_mlr put    -v '$x =  1 **  2 +  3'  /dev/null
  994 run_mlr filter -v '      1 **  2 +  3'  /dev/null
  995 run_mlr put    -v '$x =  1 +  (2 ** 3)' /dev/null
  996 run_mlr filter -v '      1 +  (2 ** 3)' /dev/null
  997 run_mlr put    -v '$x =  1 ** (2 +  3)' /dev/null
  998 run_mlr filter -v '      1 ** (2 +  3)' /dev/null
  999 run_mlr put    -v '$x = (1 +  2) ** 3'  /dev/null
 1000 run_mlr filter -v '     (1 +  2) ** 3'  /dev/null
 1001 run_mlr put    -v '$x = (1 ** 2) +  3'  /dev/null
 1002 run_mlr filter -v '     (1 ** 2) +  3'  /dev/null
 1003 
 1004 run_mlr put    -v '$x =  1 *   2 ** 3'  /dev/null
 1005 run_mlr filter -v '      1 *   2 ** 3'  /dev/null
 1006 run_mlr put    -v '$x =  1 **  2 *  3'  /dev/null
 1007 run_mlr filter -v '      1 **  2 *  3'  /dev/null
 1008 run_mlr put    -v '$x =  1 *  (2 ** 3)' /dev/null
 1009 run_mlr filter -v '      1 *  (2 ** 3)' /dev/null
 1010 run_mlr put    -v '$x =  1 ** (2 *  3)' /dev/null
 1011 run_mlr filter -v '      1 ** (2 *  3)' /dev/null
 1012 run_mlr put    -v '$x = (1 *  2) ** 3'  /dev/null
 1013 run_mlr filter -v '     (1 *  2) ** 3'  /dev/null
 1014 run_mlr put    -v '$x = (1 ** 2) *  3'  /dev/null
 1015 run_mlr filter -v '     (1 ** 2) *  3'  /dev/null
 1016 
 1017 run_mlr put    -v '$x = -1 +  2 *  3'  /dev/null
 1018 run_mlr filter -v '     -1 +  2 *  3'  /dev/null
 1019 run_mlr put    -v '$x = -1 *  2 +  3'  /dev/null
 1020 run_mlr filter -v '     -1 *  2 +  3'  /dev/null
 1021 run_mlr put    -v '$x =  1 + -2 *  3'  /dev/null
 1022 run_mlr filter -v '      1 + -2 *  3'  /dev/null
 1023 run_mlr put    -v '$x =  1 * -2 +  3'  /dev/null
 1024 run_mlr filter -v '      1 * -2 +  3'  /dev/null
 1025 run_mlr put    -v '$x =  1 +  2 * -3'  /dev/null
 1026 run_mlr filter -v '      1 +  2 * -3'  /dev/null
 1027 run_mlr put    -v '$x =  1 *  2 + -3'  /dev/null
 1028 run_mlr filter -v '      1 *  2 + -3'  /dev/null
 1029 
 1030 run_mlr put    -v '$x = ~1 |  2 &  3'  /dev/null
 1031 run_mlr filter -v '     ~1 |  2 &  3'  /dev/null
 1032 run_mlr put    -v '$x = ~1 &  2 |  3'  /dev/null
 1033 run_mlr filter -v '     ~1 &  2 |  3'  /dev/null
 1034 run_mlr put    -v '$x =  1 | ~2 &  3'  /dev/null
 1035 run_mlr filter -v '      1 | ~2 &  3'  /dev/null
 1036 run_mlr put    -v '$x =  1 & ~2 |  3'  /dev/null
 1037 run_mlr filter -v '      1 & ~2 |  3'  /dev/null
 1038 run_mlr put    -v '$x =  1 |  2 & ~3'  /dev/null
 1039 run_mlr filter -v '      1 |  2 & ~3'  /dev/null
 1040 run_mlr put    -v '$x =  1 &  2 | ~3'  /dev/null
 1041 run_mlr filter -v '      1 &  2 | ~3'  /dev/null
 1042 
 1043 run_mlr put    -v '$x = $a==1 && $b == 1 && $c == 1' /dev/null
 1044 run_mlr filter -v '     $a==1 && $b == 1 && $c == 1' /dev/null
 1045 run_mlr put    -v '$x = $a==1 || $b == 1 && $c == 1' /dev/null
 1046 run_mlr filter -v '     $a==1 || $b == 1 && $c == 1' /dev/null
 1047 run_mlr put    -v '$x = $a==1 || $b == 1 || $c == 1' /dev/null
 1048 run_mlr filter -v '     $a==1 || $b == 1 || $c == 1' /dev/null
 1049 run_mlr put    -v '$x = $a==1 && $b == 1 || $c == 1' /dev/null
 1050 run_mlr filter -v '     $a==1 && $b == 1 || $c == 1' /dev/null
 1051 
 1052 run_mlr put    -v '$x = $a==1 ? $b == 2 : $c == 3' /dev/null
 1053 run_mlr filter -v '     $a==1 ? $b == 2 : $c == 3' /dev/null
 1054 
 1055 run_mlr put    -v '$x = true' /dev/null
 1056 run_mlr filter -v '     true' /dev/null
 1057 
 1058 run_mlr put    -v 'true || 1==0; $x = 3' /dev/null
 1059 run_mlr filter -v '        true || 1==0' /dev/null
 1060 
 1061 run_mlr put    -v '1==0 || false; $x = 3' /dev/null
 1062 run_mlr filter -v '        1==0 || false' /dev/null
 1063 
 1064 run_mlr put    -v 'true && false; $x = 3' /dev/null
 1065 run_mlr filter -v '        true && false' /dev/null
 1066 
 1067 run_mlr put    -v 'true && false && true; $x = 3' /dev/null
 1068 run_mlr filter -v '        true && false && true' /dev/null
 1069 
 1070 run_mlr put    -v '$y += $x + 3'  /dev/null
 1071 run_mlr put    -v '$y += $x * 3'  /dev/null
 1072 
 1073 run_mlr put -v '$y ||= $x' /dev/null
 1074 run_mlr put -v '$y ^^= $x' /dev/null
 1075 run_mlr put -v '$y &&= $x' /dev/null
 1076 run_mlr put -v '$y |=  $x' /dev/null
 1077 run_mlr put -v '$y ^=  $x' /dev/null
 1078 run_mlr put -v '$y &=  $x' /dev/null
 1079 run_mlr put -v '$y <<= $x' /dev/null
 1080 run_mlr put -v '$y >>= $x' /dev/null
 1081 run_mlr put -v '$y +=  $x' /dev/null
 1082 run_mlr put -v '$y -=  $x' /dev/null
 1083 run_mlr put -v '$y .=  $x' /dev/null
 1084 run_mlr put -v '$y *=  $x' /dev/null
 1085 run_mlr put -v '$y /=  $x' /dev/null
 1086 run_mlr put -v '$y //= $x' /dev/null
 1087 run_mlr put -v '$y %=  $x' /dev/null
 1088 run_mlr put -v '$y **= $x' /dev/null
 1089 
 1090 # ----------------------------------------------------------------
 1091 announce DSL COMMENTS
 1092 
 1093 run_mlr --from $indir/abixy put '
 1094   $s = 1;
 1095   #$t = 2;
 1096   $u = 3;
 1097 '
 1098 
 1099 run_mlr --from $indir/abixy filter '
 1100   NR == 1 ||
 1101   #NR == 2 ||
 1102   NR == 3
 1103 '
 1104 
 1105 run_mlr --from $indir/abixy put '
 1106   $s = "here is a pound#sign"; # but this is a comment
 1107   #$t = 2;
 1108   $u = 3;
 1109 '
 1110 
 1111 # ----------------------------------------------------------------
 1112 announce DSL EMPTY STATEMENTS
 1113 
 1114 run_mlr -n put -v ''
 1115 mlr_expect_fail -n filter -v ''
 1116 
 1117 run_mlr -n put -v 'begin {}'
 1118 run_mlr -n put -v 'begin {;}'
 1119 run_mlr -n put -v 'begin {;;}'
 1120 run_mlr -n put -v 'begin {;;;}'
 1121 run_mlr -n put -v 'begin {@x=1}'
 1122 run_mlr -n put -v 'begin {@x=1;}'
 1123 run_mlr -n put -v 'begin {;@x=1}'
 1124 run_mlr -n put -v 'begin {@x=1;@y=2}'
 1125 run_mlr -n put -v 'begin {@x=1;;@y=2}'
 1126 
 1127 run_mlr -n put -v 'true {}'
 1128 run_mlr -n put -v 'true {;}'
 1129 run_mlr -n put -v 'true {;;}'
 1130 run_mlr -n put -v 'true {;;;}'
 1131 run_mlr -n put -v 'true {@x=1}'
 1132 run_mlr -n put -v 'true {@x=1;}'
 1133 run_mlr -n put -v 'true {;@x=1}'
 1134 run_mlr -n put -v 'true {@x=1;@y=2}'
 1135 run_mlr -n put -v 'true {@x=1;;@y=2}'
 1136 
 1137 run_mlr -n put -v 'end {}'
 1138 run_mlr -n put -v 'end {;}'
 1139 run_mlr -n put -v 'end {;;}'
 1140 run_mlr -n put -v 'end {;;;}'
 1141 run_mlr -n put -v 'end {@x=1}'
 1142 run_mlr -n put -v 'end {@x=1;}'
 1143 run_mlr -n put -v 'end {;@x=1}'
 1144 run_mlr -n put -v 'end {@x=1;@y=2}'
 1145 run_mlr -n put -v 'end {@x=1;;@y=2}'
 1146 
 1147 # ----------------------------------------------------------------
 1148 announce DSL CONTEXT-SPECIFIC VALIDATION
 1149 
 1150 mention non-top-level begin/end
 1151 mlr_expect_fail put -v 'begin{begin{@x=1}}'
 1152 mlr_expect_fail put -v 'true{begin{@x=1}}'
 1153 mlr_expect_fail put -v 'end{end{@x=1}}'
 1154 mlr_expect_fail put -v 'true{end{@x=1}}'
 1155 
 1156 mention srecs in begin/end
 1157 mlr_expect_fail put -v 'begin{$x=1}'
 1158 mlr_expect_fail put -v 'begin{@x=$y}'
 1159 mlr_expect_fail put -v 'end{$x=1}'
 1160 mlr_expect_fail put -v 'end{@x=$y}'
 1161 mlr_expect_fail put -v 'begin{@v=$*}'
 1162 mlr_expect_fail put -v 'end{$*=@v}'
 1163 
 1164 mlr_expect_fail put -v 'begin{unset $x}'
 1165 mlr_expect_fail put -v 'end{unset $x}'
 1166 mlr_expect_fail put -v 'begin{unset $*}'
 1167 mlr_expect_fail put -v 'end{unset $*}'
 1168 
 1169 mention break/continue outside loop
 1170 mlr_expect_fail put -v 'break'
 1171 mlr_expect_fail put -v 'continue'
 1172 
 1173 mention oosvars etc. in mlr filter
 1174 mlr_expect_fail filter -v 'break'
 1175 mlr_expect_fail filter -v 'continue'
 1176 
 1177 mention expanded filter
 1178 
 1179 run_mlr --from $indir/abixy filter '
 1180   begin {
 1181     @avoid = 3
 1182   }
 1183   NR != @avoid
 1184 '
 1185 
 1186 run_mlr --from $indir/abixy filter -x '
 1187   begin {
 1188     @avoid = 3
 1189   }
 1190   NR != @avoid
 1191 '
 1192 
 1193 run_mlr --from $indir/abixy filter '
 1194   func f(n) {
 1195     return n - 1
 1196   }
 1197   f(NR) == 5
 1198 '
 1199 
 1200 run_mlr --from $indir/abixy filter '
 1201   subr s(n) {
 1202     print "NR is ".n
 1203   }
 1204   call s(NR);
 1205   false
 1206 '
 1207 
 1208 run_mlr --from $indir/abixy filter '
 1209   int a = 5;
 1210   int b = 7;
 1211   a <= NR && NR <= b
 1212 '
 1213 
 1214 mlr_expect_fail --from $indir/abixy filter 'filter false'
 1215 mlr_expect_fail --from $indir/abixy filter 'filter false; true'
 1216 
 1217 # ----------------------------------------------------------------
 1218 announce DSL FUNCTIONAL TESTS
 1219 
 1220 run_mlr filter '$x>.3'    $indir/abixy
 1221 run_mlr filter '$x>.3;'   $indir/abixy
 1222 run_mlr filter '$x>0.3'   $indir/abixy
 1223 run_mlr filter '$x>0.3 && $y>0.3'   $indir/abixy
 1224 run_mlr filter '$x>0.3 || $y>0.3'   $indir/abixy
 1225 run_mlr filter 'NR>=4 && NR <= 7'   $indir/abixy
 1226 
 1227 run_mlr filter -x '$x>.3'    $indir/abixy
 1228 run_mlr filter -x '$x>0.3'   $indir/abixy
 1229 run_mlr filter -x '$x>0.3 && $y>0.3'   $indir/abixy
 1230 run_mlr filter -x '$x>0.3 || $y>0.3'   $indir/abixy
 1231 run_mlr filter -x 'NR>=4 && NR <= 7'   $indir/abixy
 1232 
 1233 run_mlr filter '$nosuchfield>.3'    $indir/abixy
 1234 
 1235 run_mlr put '$x2 = $x**2'  $indir/abixy
 1236 run_mlr put '$x2 = $x**2;' $indir/abixy
 1237 run_mlr put '$z = -0.024*$x+0.13' $indir/abixy
 1238 run_mlr put '$c = $a . $b' $indir/abixy
 1239 run_mlr put '$ii = $i + $i' $indir/abixy
 1240 run_mlr put '$emptytest = $i + $nosuch' $indir/abixy
 1241 
 1242 run_mlr --opprint put '$nr=NR;$fnr=FNR;$nf=NF;$filenum=FILENUM' $indir/abixy $indir/abixy
 1243 
 1244 run_mlr --opprint put '$y=madd($x,10,37)' then put '$z=msub($x,10,37)' $indir/modarith.dat
 1245 run_mlr --opprint put '$y=mexp($x,35,37)' then put '$z=mmul($x,$y,37)' $indir/modarith.dat
 1246 
 1247 run_mlr put '$z=min($x, $y)' $indir/minmax.dkvp
 1248 run_mlr put '$z=max($x, $y)' $indir/minmax.dkvp
 1249 
 1250 echo 'x=1,y=2,z=3' | run_mlr put '$o=min()'
 1251 echo 'x=1,y=2,z=3' | run_mlr put '$o=max()'
 1252 echo 'x=1,y=2,z=3' | run_mlr put '$o=min($x)'
 1253 echo 'x=1,y=2,z=3' | run_mlr put '$o=max($x)'
 1254 echo 'x=1,y=2,z=3' | run_mlr put '$o=min($x,$y)'
 1255 echo 'x=1,y=2,z=3' | run_mlr put '$o=max($x,$y)'
 1256 echo 'x=1,y=2,z=3' | run_mlr put '$o=min($x,$y,$z)'
 1257 echo 'x=1,y=2,z=3' | run_mlr put '$o=max($x,$y,$z)'
 1258 
 1259 echo 'x=1,y=b' | run_mlr put '$u=min($x,$y);$v=max($x,$y)'
 1260 echo 'x=a,y=2' | run_mlr put '$u=min($x,$y);$v=max($x,$y)'
 1261 echo 'x=a,y=b' | run_mlr put '$u=min($x,$y);$v=max($x,$y)'
 1262 
 1263 run_mlr --icsvlite --oxtab put '${x+y} = ${name.x} + ${name.y}; ${x*y} = ${name.x} * ${name.y}' $indir/braced.csv
 1264 run_mlr --icsvlite --oxtab filter '${name.y} < ${z}' $indir/braced.csv
 1265 
 1266 run_mlr --opprint put '$z = $x < 0.5 ? 0 : 1' $indir/abixy
 1267 
 1268 run_mlr --csvlite filter 'true  && true'  $indir/b.csv
 1269 run_mlr --csvlite filter 'true  && false' $indir/b.csv
 1270 run_mlr --csvlite filter 'false && true'  $indir/b.csv
 1271 run_mlr --csvlite filter 'false && false' $indir/b.csv
 1272 
 1273 run_mlr --csvlite filter 'true  || true'  $indir/b.csv
 1274 run_mlr --csvlite filter 'true  || false' $indir/b.csv
 1275 run_mlr --csvlite filter 'false || true'  $indir/b.csv
 1276 run_mlr --csvlite filter 'false || false' $indir/b.csv
 1277 
 1278 run_mlr --csvlite filter 'true  ^^ true'  $indir/b.csv
 1279 run_mlr --csvlite filter 'true  ^^ false' $indir/b.csv
 1280 run_mlr --csvlite filter 'false ^^ true'  $indir/b.csv
 1281 run_mlr --csvlite filter 'false ^^ false' $indir/b.csv
 1282 
 1283 # This tests boolean short-circuiting
 1284 run_mlr put '$x==2 && $a =~ "....." { $y=4 }'  $indir/short-circuit.dkvp
 1285 
 1286 export X=97
 1287 export Y=98
 1288 run_mlr put '$x = ENV["X"]; $y = ENV[$name]' $indir/env-var.dkvp
 1289 export X=
 1290 export Y=
 1291 run_mlr put '$x = ENV["X"]; $y = ENV[$name]' $indir/env-var.dkvp
 1292 
 1293 run_mlr -n put 'begin{ENV["HOME"]="foobar"} end{print ENV["HOME"]}'
 1294 
 1295 echo 'x=hello' | run_mlr put '$y = toupper($x)'
 1296 echo 'x=HELLO' | run_mlr put '$y = toupper($x)'
 1297 echo 'x='      | run_mlr put '$y = toupper($x)'
 1298 echo 'x=hello' | run_mlr put '$y = toupper($z)'
 1299 
 1300 echo 'x=hello' | run_mlr put '$y = tolower($x)'
 1301 echo 'x=HELLO' | run_mlr put '$y = tolower($x)'
 1302 echo 'x='      | run_mlr put '$y = tolower($x)'
 1303 echo 'x=hello' | run_mlr put '$y = tolower($z)'
 1304 
 1305 echo 'x=hello' | run_mlr put '$y = capitalize($x)'
 1306 echo 'x=HELLO' | run_mlr put '$y = capitalize($x)'
 1307 echo 'x='      | run_mlr put '$y = capitalize($x)'
 1308 echo 'x=hello' | run_mlr put '$y = capitalize($z)'
 1309 
 1310 mention LHS value on first record should result in ZYX for process creation
 1311 export indir; run_mlr --from $indir/abixy put -q 'ENV["ZYX"]="CBA".NR; print | ENV["indir"]."/env-assign.sh" , "a is " . $a'
 1312 
 1313 # ----------------------------------------------------------------
 1314 announce POSITIONAL INDEXING
 1315 
 1316 run_mlr --opprint put '$NEW = $[[3]]'     $indir/abixy
 1317 run_mlr --opprint put '$NEW = $[[[3]]]'   $indir/abixy
 1318 
 1319 run_mlr --opprint put '$NEW = $[[11]]'    $indir/abixy
 1320 run_mlr --opprint put '$NEW = $[[[11]]]'  $indir/abixy
 1321 
 1322 run_mlr --opprint put '$[[3]]   = "NEW"'  $indir/abixy
 1323 run_mlr --opprint put '$[[[3]]] = "NEW"'  $indir/abixy
 1324 
 1325 run_mlr --opprint put '$[[11]]   = "NEW"' $indir/abixy
 1326 run_mlr --opprint put '$[[[11]]] = "NEW"' $indir/abixy
 1327 
 1328 run_mlr --opprint put '$[[1]] = $[[2]]' $indir/abixy
 1329 
 1330 run_mlr --opprint put '$a     = $[[2]]; unset $["a"]' $indir/abixy
 1331 run_mlr --opprint put '$[[1]] = $b;     unset $[[1]]' $indir/abixy
 1332 run_mlr --opprint put '$[[1]] = $[[2]]; unset $["a"]' $indir/abixy
 1333 
 1334 # xxx to do -- there is an old bug here with lack of lhmsmv_unset on the typed overlay at unset
 1335 run_mlr --opprint put 'unset $c' $indir/abixy
 1336 run_mlr --opprint put 'unset $c; $c="new"' $indir/abixy
 1337 run_mlr --opprint put '$c=$a.$b; unset $c; $c="new"' $indir/abixy
 1338 run_mlr --opprint put '$c=$a.$b; unset $c' $indir/abixy
 1339 
 1340 # ----------------------------------------------------------------
 1341 announce IS-PREDICATES
 1342 
 1343 run_mlr --opprint put '$f=is_absent($x)'                          $indir/nullvals.dkvp
 1344 run_mlr --opprint put '$f=is_absent($y)'                          $indir/nullvals.dkvp
 1345 run_mlr --opprint put '$f=is_absent($z)'                          $indir/nullvals.dkvp
 1346 run_mlr --opprint put '$f=is_absent($nosuch)'                     $indir/nullvals.dkvp
 1347 run_mlr --opprint put '$f=is_absent(@nosuch)'                     $indir/nullvals.dkvp
 1348 run_mlr --opprint put '@somesuch=1;$f=is_absent(@somesuch)'       $indir/nullvals.dkvp
 1349 
 1350 run_mlr --opprint put '$f=is_bool($x>1)'                          $indir/nullvals.dkvp
 1351 run_mlr --opprint put '$f=is_bool($y>1)'                          $indir/nullvals.dkvp
 1352 run_mlr --opprint put '$f=is_bool($z>1)'                          $indir/nullvals.dkvp
 1353 run_mlr --opprint put '$f=is_bool($nosuch>1)'                     $indir/nullvals.dkvp
 1354 run_mlr --opprint put '$f=is_bool(@nosuch>1)'                     $indir/nullvals.dkvp
 1355 run_mlr --opprint put '@somesuch=1;$f=is_bool(@somesuch>1)'       $indir/nullvals.dkvp
 1356 
 1357 run_mlr --opprint put '$f=is_boolean($x>1)'                       $indir/nullvals.dkvp
 1358 run_mlr --opprint put '$f=is_boolean($y>1)'                       $indir/nullvals.dkvp
 1359 run_mlr --opprint put '$f=is_boolean($z>1)'                       $indir/nullvals.dkvp
 1360 run_mlr --opprint put '$f=is_boolean($nosuch>1)'                  $indir/nullvals.dkvp
 1361 run_mlr --opprint put '$f=is_boolean(@nosuch>1)'                  $indir/nullvals.dkvp
 1362 run_mlr --opprint put '@somesuch=1;$f=is_boolean(@somesuch>1)'    $indir/nullvals.dkvp
 1363 
 1364 run_mlr --opprint put '$f=is_empty($x)'                           $indir/nullvals.dkvp
 1365 run_mlr --opprint put '$f=is_empty($y)'                           $indir/nullvals.dkvp
 1366 run_mlr --opprint put '$f=is_empty($z)'                           $indir/nullvals.dkvp
 1367 run_mlr --opprint put '$f=is_empty($nosuch)'                      $indir/nullvals.dkvp
 1368 run_mlr --opprint put '$f=is_empty(@nosuch)'                      $indir/nullvals.dkvp
 1369 run_mlr --opprint put '$f=is_empty($*)'                           $indir/nullvals.dkvp
 1370 run_mlr --opprint put '$f=is_empty({1:2})'                        $indir/nullvals.dkvp
 1371 run_mlr --opprint put '@somesuch=1;$f=is_empty(@somesuch)'        $indir/nullvals.dkvp
 1372 
 1373 run_mlr --opprint put '$f=is_empty_map($x)'                       $indir/nullvals.dkvp
 1374 run_mlr --opprint put '$f=is_empty_map($y)'                       $indir/nullvals.dkvp
 1375 run_mlr --opprint put '$f=is_empty_map($z)'                       $indir/nullvals.dkvp
 1376 run_mlr --opprint put '$f=is_empty_map($nosuch)'                  $indir/nullvals.dkvp
 1377 run_mlr --opprint put '$f=is_empty_map(@nosuch)'                  $indir/nullvals.dkvp
 1378 run_mlr --opprint put '$f=is_empty_map($*)'                       $indir/nullvals.dkvp
 1379 run_mlr --opprint put '$f=is_empty_map({1:2})'                    $indir/nullvals.dkvp
 1380 run_mlr --opprint put '$f=is_empty_map({})'                       $indir/nullvals.dkvp
 1381 run_mlr --opprint put '@somesuch=1;$f=is_empty_map(@somesuch)'    $indir/nullvals.dkvp
 1382 
 1383 run_mlr --opprint put '$f=is_float($x)'                           $indir/nullvals.dkvp
 1384 run_mlr --opprint put '$f=is_float($y)'                           $indir/nullvals.dkvp
 1385 run_mlr --opprint put '$f=is_float($z)'                           $indir/nullvals.dkvp
 1386 run_mlr --opprint put '$f=is_float($nosuch)'                      $indir/nullvals.dkvp
 1387 run_mlr --opprint put '$f=is_float(@nosuch)'                      $indir/nullvals.dkvp
 1388 run_mlr --opprint put '$f=is_float($*)'                           $indir/nullvals.dkvp
 1389 run_mlr --opprint put '$f=is_float({1:2})'                        $indir/nullvals.dkvp
 1390 run_mlr --opprint put '@somesuch=1;$f=is_float(@somesuch)'        $indir/nullvals.dkvp
 1391 
 1392 run_mlr --opprint put '$f=is_int($x)'                             $indir/nullvals.dkvp
 1393 run_mlr --opprint put '$f=is_int($y)'                             $indir/nullvals.dkvp
 1394 run_mlr --opprint put '$f=is_int($z)'                             $indir/nullvals.dkvp
 1395 run_mlr --opprint put '$f=is_int($nosuch)'                        $indir/nullvals.dkvp
 1396 run_mlr --opprint put '$f=is_int(@nosuch)'                        $indir/nullvals.dkvp
 1397 run_mlr --opprint put '$f=is_int($*)'                             $indir/nullvals.dkvp
 1398 run_mlr --opprint put '$f=is_int({1:2})'                          $indir/nullvals.dkvp
 1399 run_mlr --opprint put '@somesuch=1;$f=is_int(@somesuch)'          $indir/nullvals.dkvp
 1400 
 1401 run_mlr --opprint put '$f=is_map($x)'                             $indir/nullvals.dkvp
 1402 run_mlr --opprint put '$f=is_map($y)'                             $indir/nullvals.dkvp
 1403 run_mlr --opprint put '$f=is_map($z)'                             $indir/nullvals.dkvp
 1404 run_mlr --opprint put '$f=is_map($nosuch)'                        $indir/nullvals.dkvp
 1405 run_mlr --opprint put '$f=is_map(@nosuch)'                        $indir/nullvals.dkvp
 1406 run_mlr --opprint put '$f=is_map($*)'                             $indir/nullvals.dkvp
 1407 run_mlr --opprint put '$f=is_map({1:2})'                          $indir/nullvals.dkvp
 1408 run_mlr --opprint put '$f=is_map({})'                             $indir/nullvals.dkvp
 1409 run_mlr --opprint put '@somesuch=1;$f=is_map(@somesuch)'          $indir/nullvals.dkvp
 1410 
 1411 run_mlr --opprint put '$f=is_nonempty_map($x)'                    $indir/nullvals.dkvp
 1412 run_mlr --opprint put '$f=is_nonempty_map($y)'                    $indir/nullvals.dkvp
 1413 run_mlr --opprint put '$f=is_nonempty_map($z)'                    $indir/nullvals.dkvp
 1414 run_mlr --opprint put '$f=is_nonempty_map($nosuch)'               $indir/nullvals.dkvp
 1415 run_mlr --opprint put '$f=is_nonempty_map(@nosuch)'               $indir/nullvals.dkvp
 1416 run_mlr --opprint put '$f=is_nonempty_map($*)'                    $indir/nullvals.dkvp
 1417 run_mlr --opprint put '$f=is_nonempty_map({1:2})'                 $indir/nullvals.dkvp
 1418 run_mlr --opprint put '$f=is_nonempty_map({})'                    $indir/nullvals.dkvp
 1419 run_mlr --opprint put '@somesuch=1;$f=is_nonempty_map(@somesuch)' $indir/nullvals.dkvp
 1420 
 1421 run_mlr --opprint put '$f=is_not_empty($x)'                       $indir/nullvals.dkvp
 1422 run_mlr --opprint put '$f=is_not_empty($y)'                       $indir/nullvals.dkvp
 1423 run_mlr --opprint put '$f=is_not_empty($z)'                       $indir/nullvals.dkvp
 1424 run_mlr --opprint put '$f=is_not_empty($nosuch)'                  $indir/nullvals.dkvp
 1425 run_mlr --opprint put '$f=is_not_empty(@nosuch)'                  $indir/nullvals.dkvp
 1426 run_mlr --opprint put '$f=is_not_empty($*)'                       $indir/nullvals.dkvp
 1427 run_mlr --opprint put '$f=is_not_empty({1:2})'                    $indir/nullvals.dkvp
 1428 run_mlr --opprint put '@somesuch=1;$f=is_not_empty(@somesuch)'    $indir/nullvals.dkvp
 1429 
 1430 run_mlr --opprint put '$f=is_not_map($x)'                         $indir/nullvals.dkvp
 1431 run_mlr --opprint put '$f=is_not_map($y)'                         $indir/nullvals.dkvp
 1432 run_mlr --opprint put '$f=is_not_map($z)'                         $indir/nullvals.dkvp
 1433 run_mlr --opprint put '$f=is_not_map($nosuch)'                    $indir/nullvals.dkvp
 1434 run_mlr --opprint put '$f=is_not_map(@nosuch)'                    $indir/nullvals.dkvp
 1435 run_mlr --opprint put '$f=is_not_map($*)'                         $indir/nullvals.dkvp
 1436 run_mlr --opprint put '$f=is_not_map({1:2})'                      $indir/nullvals.dkvp
 1437 run_mlr --opprint put '$f=is_not_map({})'                         $indir/nullvals.dkvp
 1438 run_mlr --opprint put '@somesuch=1;$f=is_not_map(@somesuch)'      $indir/nullvals.dkvp
 1439 
 1440 run_mlr --opprint put '$f=is_not_null($x)'                        $indir/nullvals.dkvp
 1441 run_mlr --opprint put '$f=is_not_null($y)'                        $indir/nullvals.dkvp
 1442 run_mlr --opprint put '$f=is_not_null($z)'                        $indir/nullvals.dkvp
 1443 run_mlr --opprint put '$f=is_not_null($nosuch)'                   $indir/nullvals.dkvp
 1444 run_mlr --opprint put '$f=is_not_null(@nosuch)'                   $indir/nullvals.dkvp
 1445 run_mlr --opprint put '@somesuch=1;$f=is_not_null(@somesuch)'     $indir/nullvals.dkvp
 1446 
 1447 run_mlr --opprint put '$f=is_null($x)'                            $indir/nullvals.dkvp
 1448 run_mlr --opprint put '$f=is_null($y)'                            $indir/nullvals.dkvp
 1449 run_mlr --opprint put '$f=is_null($z)'                            $indir/nullvals.dkvp
 1450 run_mlr --opprint put '$f=is_null($nosuch)'                       $indir/nullvals.dkvp
 1451 run_mlr --opprint put '$f=is_null(@nosuch)'                       $indir/nullvals.dkvp
 1452 run_mlr --opprint put '@somesuch=1;$f=is_null(@somesuch)'         $indir/nullvals.dkvp
 1453 
 1454 run_mlr --opprint put '$f=is_numeric($x)'                         $indir/nullvals.dkvp
 1455 run_mlr --opprint put '$f=is_numeric($y)'                         $indir/nullvals.dkvp
 1456 run_mlr --opprint put '$f=is_numeric($z)'                         $indir/nullvals.dkvp
 1457 run_mlr --opprint put '$f=is_numeric($nosuch)'                    $indir/nullvals.dkvp
 1458 run_mlr --opprint put '$f=is_numeric(@nosuch)'                    $indir/nullvals.dkvp
 1459 run_mlr --opprint put '@somesuch=1;$f=is_numeric(@somesuch)'      $indir/nullvals.dkvp
 1460 
 1461 run_mlr --opprint put '$f=is_present($x)'                         $indir/nullvals.dkvp
 1462 run_mlr --opprint put '$f=is_present($y)'                         $indir/nullvals.dkvp
 1463 run_mlr --opprint put '$f=is_present($z)'                         $indir/nullvals.dkvp
 1464 run_mlr --opprint put '$f=is_present($nosuch)'                    $indir/nullvals.dkvp
 1465 run_mlr --opprint put '$f=is_present(@nosuch)'                    $indir/nullvals.dkvp
 1466 run_mlr --opprint put '@somesuch=1;$f=is_present(@somesuch)'      $indir/nullvals.dkvp
 1467 
 1468 run_mlr --opprint put '$f=is_string($x)'                          $indir/nullvals.dkvp
 1469 run_mlr --opprint put '$f=is_string($y)'                          $indir/nullvals.dkvp
 1470 run_mlr --opprint put '$f=is_string($z)'                          $indir/nullvals.dkvp
 1471 run_mlr --opprint put '$f=is_string($nosuch)'                     $indir/nullvals.dkvp
 1472 run_mlr --opprint put '$f=is_string(@nosuch)'                     $indir/nullvals.dkvp
 1473 run_mlr --opprint put '@somesuch=1;$f=is_string(@somesuch)'       $indir/nullvals.dkvp
 1474 
 1475 # ----------------------------------------------------------------
 1476 announce ASSERTION PASS-THROUGHS
 1477 
 1478 run_mlr         --opprint put '$f=asserting_absent($nosuch)'                     $indir/nullvals.dkvp
 1479 run_mlr         --opprint put '$f=asserting_absent(@nosuch)'                     $indir/nullvals.dkvp
 1480 mlr_expect_fail --opprint put '$f=asserting_absent($x)'                          $indir/nullvals.dkvp
 1481 mlr_expect_fail --opprint put '$f=asserting_absent($y)'                          $indir/nullvals.dkvp
 1482 mlr_expect_fail --opprint put '$f=asserting_absent($z)'                          $indir/nullvals.dkvp
 1483 mlr_expect_fail --opprint put '@somesuch=1;$f=asserting_absent(@somesuch)'       $indir/nullvals.dkvp
 1484 mlr_expect_fail --opprint put 'foo=asserting_absent($*)'                         $indir/nullvals.dkvp
 1485 mlr_expect_fail --opprint put 'foo=asserting_absent({1:2})'                      $indir/nullvals.dkvp
 1486 
 1487 run_mlr         --opprint put '$f=asserting_empty($z)'                           $indir/nullvals.dkvp
 1488 mlr_expect_fail --opprint put '$f=asserting_empty($x)'                           $indir/nullvals.dkvp
 1489 mlr_expect_fail --opprint put '$f=asserting_empty($y)'                           $indir/nullvals.dkvp
 1490 mlr_expect_fail --opprint put '$f=asserting_empty($nosuch)'                      $indir/nullvals.dkvp
 1491 mlr_expect_fail --opprint put '$f=asserting_empty(@nosuch)'                      $indir/nullvals.dkvp
 1492 mlr_expect_fail --opprint put '$f=asserting_empty({1:2})'                        $indir/nullvals.dkvp
 1493 mlr_expect_fail --opprint put '@somesuch=1;$f=asserting_empty(@somesuch)'        $indir/nullvals.dkvp
 1494 mlr_expect_fail --opprint put 'foo=asserting_empty($*)'                          $indir/nullvals.dkvp
 1495 mlr_expect_fail --opprint put 'foo=asserting_empty({1:2})'                       $indir/nullvals.dkvp
 1496 
 1497 run_mlr         --opprint put '$f=asserting_empty_map({})'                       $indir/nullvals.dkvp
 1498 mlr_expect_fail --opprint put '$f=asserting_empty_map($*)'                       $indir/nullvals.dkvp
 1499 mlr_expect_fail --opprint put '$f=asserting_empty_map($x)'                       $indir/nullvals.dkvp
 1500 mlr_expect_fail --opprint put '$f=asserting_empty_map($y)'                       $indir/nullvals.dkvp
 1501 mlr_expect_fail --opprint put '$f=asserting_empty_map($z)'                       $indir/nullvals.dkvp
 1502 mlr_expect_fail --opprint put '$f=asserting_empty_map($nosuch)'                  $indir/nullvals.dkvp
 1503 mlr_expect_fail --opprint put '$f=asserting_empty_map(@nosuch)'                  $indir/nullvals.dkvp
 1504 mlr_expect_fail --opprint put '$f=asserting_empty_map({1:2})'                    $indir/nullvals.dkvp
 1505 mlr_expect_fail --opprint put '@somesuch=1;$f=asserting_empty_map(@somesuch)'    $indir/nullvals.dkvp
 1506 
 1507 run_mlr         --opprint put '$f=asserting_map($*)'                             $indir/nullvals.dkvp
 1508 run_mlr         --opprint put '$f=asserting_map({1:2})'                          $indir/nullvals.dkvp
 1509 run_mlr         --opprint put '$f=asserting_map({})'                             $indir/nullvals.dkvp
 1510 mlr_expect_fail --opprint put '$f=asserting_map($x)'                             $indir/nullvals.dkvp
 1511 mlr_expect_fail --opprint put '$f=asserting_map($y)'                             $indir/nullvals.dkvp
 1512 mlr_expect_fail --opprint put '$f=asserting_map($z)'                             $indir/nullvals.dkvp
 1513 mlr_expect_fail --opprint put '$f=asserting_map($nosuch)'                        $indir/nullvals.dkvp
 1514 mlr_expect_fail --opprint put '$f=asserting_map(@nosuch)'                        $indir/nullvals.dkvp
 1515 mlr_expect_fail --opprint put '@somesuch=1;$f=asserting_map(@somesuch)'          $indir/nullvals.dkvp
 1516 
 1517 run_mlr         --opprint put '$f=asserting_nonempty_map($*)'                    $indir/nullvals.dkvp
 1518 run_mlr         --opprint put '$f=asserting_nonempty_map({1:2})'                 $indir/nullvals.dkvp
 1519 mlr_expect_fail --opprint put '$f=asserting_nonempty_map($x)'                    $indir/nullvals.dkvp
 1520 mlr_expect_fail --opprint put '$f=asserting_nonempty_map($y)'                    $indir/nullvals.dkvp
 1521 mlr_expect_fail --opprint put '$f=asserting_nonempty_map($z)'                    $indir/nullvals.dkvp
 1522 mlr_expect_fail --opprint put '$f=asserting_nonempty_map($nosuch)'               $indir/nullvals.dkvp
 1523 mlr_expect_fail --opprint put '$f=asserting_nonempty_map(@nosuch)'               $indir/nullvals.dkvp
 1524 mlr_expect_fail --opprint put '$f=asserting_nonempty_map({})'                    $indir/nullvals.dkvp
 1525 mlr_expect_fail --opprint put '@somesuch=1;$f=asserting_nonempty_map(@somesuch)' $indir/nullvals.dkvp
 1526 
 1527 run_mlr         --opprint put '$*=asserting_not_empty($*)'                       $indir/nullvals.dkvp
 1528 run_mlr         --opprint put '$f=asserting_not_empty($nosuch)'                  $indir/nullvals.dkvp
 1529 run_mlr         --opprint put '$f=asserting_not_empty(@nosuch)'                  $indir/nullvals.dkvp
 1530 run_mlr         --opprint put '$f=asserting_not_empty({1:2})'                    $indir/nullvals.dkvp
 1531 run_mlr         --opprint put '$nosuch=asserting_not_empty($nosuch)'             $indir/nullvals.dkvp
 1532 run_mlr         --opprint put '@somesuch=1;$f=asserting_not_empty(@somesuch)'    $indir/nullvals.dkvp
 1533 run_mlr         --opprint put '$*=asserting_not_empty($*)'                       $indir/nullvals.dkvp
 1534 run_mlr         --opprint put '$*=asserting_not_empty({1:2})'                    $indir/nullvals.dkvp
 1535 mlr_expect_fail --opprint put '$f=asserting_not_empty($x)'                       $indir/nullvals.dkvp
 1536 mlr_expect_fail --opprint put '$f=asserting_not_empty($y)'                       $indir/nullvals.dkvp
 1537 mlr_expect_fail --opprint put '$f=asserting_not_empty($z)'                       $indir/nullvals.dkvp
 1538 
 1539 run_mlr         --opprint put '$f=asserting_not_map($x)'                         $indir/nullvals.dkvp
 1540 run_mlr         --opprint put '$f=asserting_not_map($y)'                         $indir/nullvals.dkvp
 1541 run_mlr         --opprint put '$f=asserting_not_map($z)'                         $indir/nullvals.dkvp
 1542 run_mlr         --opprint put '$f=asserting_not_map($nosuch)'                    $indir/nullvals.dkvp
 1543 run_mlr         --opprint put '$f=asserting_not_map(@nosuch)'                    $indir/nullvals.dkvp
 1544 run_mlr         --opprint put '@somesuch=1;$f=asserting_not_map(@somesuch)'      $indir/nullvals.dkvp
 1545 mlr_expect_fail --opprint put '$f=asserting_not_map($*)'                         $indir/nullvals.dkvp
 1546 mlr_expect_fail --opprint put '$f=asserting_not_map({1:2})'                      $indir/nullvals.dkvp
 1547 mlr_expect_fail --opprint put '$f=asserting_not_map({})'                         $indir/nullvals.dkvp
 1548 
 1549 run_mlr         --opprint put '@somesuch=1;$f=asserting_not_null(@somesuch)'     $indir/nullvals.dkvp
 1550 run_mlr         --opprint put '$*=asserting_not_null($*)'                        $indir/nullvals.dkvp
 1551 run_mlr         --opprint put '$*=asserting_not_null({1:2})'                     $indir/nullvals.dkvp
 1552 mlr_expect_fail --opprint put '$f=asserting_not_null($x)'                        $indir/nullvals.dkvp
 1553 mlr_expect_fail --opprint put '$f=asserting_not_null($y)'                        $indir/nullvals.dkvp
 1554 mlr_expect_fail --opprint put '$f=asserting_not_null($z)'                        $indir/nullvals.dkvp
 1555 mlr_expect_fail --opprint put '$f=asserting_not_null($nosuch)'                   $indir/nullvals.dkvp
 1556 mlr_expect_fail --opprint put '$f=asserting_not_null(@nosuch)'                   $indir/nullvals.dkvp
 1557 
 1558 run_mlr         --opprint put '$f=asserting_null($z)'                            $indir/nullvals.dkvp
 1559 run_mlr         --opprint put '$f=asserting_null($nosuch)'                       $indir/nullvals.dkvp
 1560 run_mlr         --opprint put '$f=asserting_null(@nosuch)'                       $indir/nullvals.dkvp
 1561 mlr_expect_fail --opprint put '$f=asserting_null($x)'                            $indir/nullvals.dkvp
 1562 mlr_expect_fail --opprint put '$f=asserting_null($y)'                            $indir/nullvals.dkvp
 1563 mlr_expect_fail --opprint put '@somesuch=1;$f=asserting_null(@somesuch)'         $indir/nullvals.dkvp
 1564 mlr_expect_fail --opprint put '$*=asserting_null($*)'                            $indir/nullvals.dkvp
 1565 mlr_expect_fail --opprint put '$*=asserting_null({1:2})'                         $indir/nullvals.dkvp
 1566 
 1567 mlr_expect_fail --opprint put '$f=asserting_numeric($x)'                         $indir/nullvals.dkvp
 1568 mlr_expect_fail --opprint put '$f=asserting_numeric($y)'                         $indir/nullvals.dkvp
 1569 mlr_expect_fail --opprint put '$f=asserting_numeric($z)'                         $indir/nullvals.dkvp
 1570 mlr_expect_fail --opprint put '$*=asserting_numeric($*)'                         $indir/nullvals.dkvp
 1571 mlr_expect_fail --opprint put '$*=asserting_numeric({1:2})'                      $indir/nullvals.dkvp
 1572 mlr_expect_fail --opprint put '$f=asserting_numeric($nosuch)'                    $indir/nullvals.dkvp
 1573 
 1574 run_mlr         --opprint put '$f=asserting_present($x)'                         $indir/nullvals.dkvp
 1575 run_mlr         --opprint put '$f=asserting_present($y)'                         $indir/nullvals.dkvp
 1576 run_mlr         --opprint put '$f=asserting_present($z)'                         $indir/nullvals.dkvp
 1577 run_mlr         --opprint put '@somesuch=1;$f=asserting_present(@somesuch)'      $indir/nullvals.dkvp
 1578 run_mlr         --opprint put '$*=asserting_present($*)'                         $indir/nullvals.dkvp
 1579 run_mlr         --opprint put '$*=asserting_present({1:2})'                      $indir/nullvals.dkvp
 1580 mlr_expect_fail --opprint put '$f=asserting_present($nosuch)'                    $indir/nullvals.dkvp
 1581 mlr_expect_fail --opprint put '$f=asserting_present(@nosuch)'                    $indir/nullvals.dkvp
 1582 
 1583 run_mlr         --opprint put '$f=asserting_string($z)'                          $indir/nullvals.dkvp
 1584 mlr_expect_fail --opprint put '$*=asserting_string($*)'                          $indir/nullvals.dkvp
 1585 mlr_expect_fail --opprint put '$*=asserting_string({1:2})'                       $indir/nullvals.dkvp
 1586 mlr_expect_fail --opprint put '$f=asserting_string($x)'                          $indir/nullvals.dkvp
 1587 mlr_expect_fail --opprint put '$f=asserting_string($y)'                          $indir/nullvals.dkvp
 1588 mlr_expect_fail --opprint put '$f=asserting_string($nosuch)'                     $indir/nullvals.dkvp
 1589 
 1590 # ----------------------------------------------------------------
 1591 announce DSL NULL/EMPTY HANDLING
 1592 
 1593 run_mlr put '$z = $s . $s'     $indir/null-vs-empty.dkvp
 1594 run_mlr put '$z = $s == ""'    $indir/null-vs-empty.dkvp
 1595 run_mlr put '$z = $s == $s'    $indir/null-vs-empty.dkvp
 1596 run_mlr put '$z = is_empty($s)' $indir/null-vs-empty.dkvp
 1597 
 1598 run_mlr put '$z = $x + $y'      $indir/null-vs-empty.dkvp
 1599 run_mlr put '$z = $y + $y'      $indir/null-vs-empty.dkvp
 1600 run_mlr put '$z = $x + $nosuch' $indir/null-vs-empty.dkvp
 1601 run_mlr put '$t = sub($s,       "ell", "X")' $indir/null-vs-empty.dkvp
 1602 run_mlr put '$t = sub($s,       "ell", "")'  $indir/null-vs-empty.dkvp
 1603 run_mlr put '$t = sub($nosuch,  "ell", "X")' $indir/null-vs-empty.dkvp
 1604 run_mlr put '$t = gsub($s,      "l",   "X")' $indir/null-vs-empty.dkvp
 1605 run_mlr put '$t = gsub($s,      "l",   "")'  $indir/null-vs-empty.dkvp
 1606 run_mlr put '$t = gsub($nosuch, "l",   "X")' $indir/null-vs-empty.dkvp
 1607 
 1608 mention EMIT
 1609 run_mlr put -q '@v=1; @nonesuch       {emit @v}' $indir/abixy
 1610 run_mlr put -q '@v=1; @nonesuch==true {emit @v}' $indir/abixy
 1611 run_mlr put -q '@v=1; $nonesuch       {emit @v}' $indir/abixy
 1612 run_mlr put -q '@v=1; $nonesuch==true {emit @v}' $indir/abixy
 1613 
 1614 mention PLUS
 1615 run_mlr --ofs tab put 'begin{};          $xy = $x + $y; $sy = @s + $y; $xt = $x + @t; $st = @s + @t' $indir/typeof.dkvp
 1616 run_mlr --ofs tab put 'begin{@s=3};      $xy = $x + $y; $sy = @s + $y; $xt = $x + @t; $st = @s + @t' $indir/typeof.dkvp
 1617 run_mlr --ofs tab put 'begin{@t=4};      $xy = $x + $y; $sy = @s + $y; $xt = $x + @t; $st = @s + @t' $indir/typeof.dkvp
 1618 run_mlr --ofs tab put 'begin{@s=3;@t=4}; $xy = $x + $y; $sy = @s + $y; $xt = $x + @t; $st = @s + @t' $indir/typeof.dkvp
 1619 
 1620 mention MINUS
 1621 run_mlr --ofs tab put 'begin{};          $xy = $x - $y; $sy = @s - $y; $xt = $x - @t; $st = @s - @t' $indir/typeof.dkvp
 1622 run_mlr --ofs tab put 'begin{@s=3};      $xy = $x - $y; $sy = @s - $y; $xt = $x - @t; $st = @s - @t' $indir/typeof.dkvp
 1623 run_mlr --ofs tab put 'begin{@t=4};      $xy = $x - $y; $sy = @s - $y; $xt = $x - @t; $st = @s - @t' $indir/typeof.dkvp
 1624 run_mlr --ofs tab put 'begin{@s=3;@t=4}; $xy = $x - $y; $sy = @s - $y; $xt = $x - @t; $st = @s - @t' $indir/typeof.dkvp
 1625 
 1626 mention TIMES
 1627 run_mlr --ofs tab put 'begin{};          $xy = $x * $y; $sy = @s * $y; $xt = $x * @t; $st = @s * @t' $indir/typeof.dkvp
 1628 run_mlr --ofs tab put 'begin{@s=3};      $xy = $x * $y; $sy = @s * $y; $xt = $x * @t; $st = @s * @t' $indir/typeof.dkvp
 1629 run_mlr --ofs tab put 'begin{@t=4};      $xy = $x * $y; $sy = @s * $y; $xt = $x * @t; $st = @s * @t' $indir/typeof.dkvp
 1630 run_mlr --ofs tab put 'begin{@s=3;@t=4}; $xy = $x * $y; $sy = @s * $y; $xt = $x * @t; $st = @s * @t' $indir/typeof.dkvp
 1631 
 1632 mention DIVIDE
 1633 run_mlr --ofs tab put 'begin{};          $xy = $x / $y; $sy = @s / $y; $xt = $x / @t; $st = @s / @t' $indir/typeof.dkvp
 1634 run_mlr --ofs tab put 'begin{@s=3};      $xy = $x / $y; $sy = @s / $y; $xt = $x / @t; $st = @s / @t' $indir/typeof.dkvp
 1635 run_mlr --ofs tab put 'begin{@t=4};      $xy = $x / $y; $sy = @s / $y; $xt = $x / @t; $st = @s / @t' $indir/typeof.dkvp
 1636 run_mlr --ofs tab put 'begin{@s=3;@t=4}; $xy = $x / $y; $sy = @s / $y; $xt = $x / @t; $st = @s / @t' $indir/typeof.dkvp
 1637 
 1638 mention INTEGER DIVIDE
 1639 run_mlr --ofs tab put 'begin{};          $xy = $x // $y; $sy = @s // $y; $xt = $x // @t; $st = @s // @t' $indir/typeof.dkvp
 1640 run_mlr --ofs tab put 'begin{@s=3};      $xy = $x // $y; $sy = @s // $y; $xt = $x // @t; $st = @s // @t' $indir/typeof.dkvp
 1641 run_mlr --ofs tab put 'begin{@t=4};      $xy = $x // $y; $sy = @s // $y; $xt = $x // @t; $st = @s // @t' $indir/typeof.dkvp
 1642 run_mlr --ofs tab put 'begin{@s=3;@t=4}; $xy = $x // $y; $sy = @s // $y; $xt = $x // @t; $st = @s // @t' $indir/typeof.dkvp
 1643 
 1644 mention REMAINDER
 1645 run_mlr --ofs tab put 'begin{};          $xy = $x % $y; $sy = @s % $y; $xt = $x % @t; $st = @s % @t' $indir/typeof.dkvp
 1646 run_mlr --ofs tab put 'begin{@s=3};      $xy = $x % $y; $sy = @s % $y; $xt = $x % @t; $st = @s % @t' $indir/typeof.dkvp
 1647 run_mlr --ofs tab put 'begin{@t=4};      $xy = $x % $y; $sy = @s % $y; $xt = $x % @t; $st = @s % @t' $indir/typeof.dkvp
 1648 run_mlr --ofs tab put 'begin{@s=3;@t=4}; $xy = $x % $y; $sy = @s % $y; $xt = $x % @t; $st = @s % @t' $indir/typeof.dkvp
 1649 
 1650 mention BITWISE AND
 1651 run_mlr --ofs tab put 'begin{};          $xy = $x & $y; $sy = @s & $y; $xt = $x & @t; $st = @s & @t' $indir/typeof.dkvp
 1652 run_mlr --ofs tab put 'begin{@s=3};      $xy = $x & $y; $sy = @s & $y; $xt = $x & @t; $st = @s & @t' $indir/typeof.dkvp
 1653 run_mlr --ofs tab put 'begin{@t=4};      $xy = $x & $y; $sy = @s & $y; $xt = $x & @t; $st = @s & @t' $indir/typeof.dkvp
 1654 run_mlr --ofs tab put 'begin{@s=3;@t=4}; $xy = $x & $y; $sy = @s & $y; $xt = $x & @t; $st = @s & @t' $indir/typeof.dkvp
 1655 
 1656 mention BITWISE OR
 1657 run_mlr --ofs tab put 'begin{};          $xy = $x | $y; $sy = @s | $y; $xt = $x | @t; $st = @s | @t' $indir/typeof.dkvp
 1658 run_mlr --ofs tab put 'begin{@s=3};      $xy = $x | $y; $sy = @s | $y; $xt = $x | @t; $st = @s | @t' $indir/typeof.dkvp
 1659 run_mlr --ofs tab put 'begin{@t=4};      $xy = $x | $y; $sy = @s | $y; $xt = $x | @t; $st = @s | @t' $indir/typeof.dkvp
 1660 run_mlr --ofs tab put 'begin{@s=3;@t=4}; $xy = $x | $y; $sy = @s | $y; $xt = $x | @t; $st = @s | @t' $indir/typeof.dkvp
 1661 
 1662 mention BITWISE XOR
 1663 run_mlr --ofs tab put 'begin{};          $xy = $x ^ $y; $sy = @s ^ $y; $xt = $x ^ @t; $st = @s ^ @t' $indir/typeof.dkvp
 1664 run_mlr --ofs tab put 'begin{@s=3};      $xy = $x ^ $y; $sy = @s ^ $y; $xt = $x ^ @t; $st = @s ^ @t' $indir/typeof.dkvp
 1665 run_mlr --ofs tab put 'begin{@t=4};      $xy = $x ^ $y; $sy = @s ^ $y; $xt = $x ^ @t; $st = @s ^ @t' $indir/typeof.dkvp
 1666 run_mlr --ofs tab put 'begin{@s=3;@t=4}; $xy = $x ^ $y; $sy = @s ^ $y; $xt = $x ^ @t; $st = @s ^ @t' $indir/typeof.dkvp
 1667 
 1668 # ----------------------------------------------------------------
 1669 announce DSL TYPE PREDICATES
 1670 
 1671 run_mlr --from $indir/abixy --opprint put ' for (k, v in $*) { $[k."_type"]      = typeof(v)     } '
 1672 
 1673 run_mlr --from $indir/abixy-het put -q 'for (k,v in $*) {if (is_float(v))    {@float[NR][k]   = v}}    end{ emit @float,   "NR", "k" }'
 1674 run_mlr --from $indir/abixy-het put -q 'for (k,v in $*) {if (is_int(v))      {@int[NR][k]     = v}}    end{ emit @int,     "NR", "k" }'
 1675 run_mlr --from $indir/abixy-het put -q 'for (k,v in $*) {if (is_numeric(v))  {@numeric[NR][k] = v}}    end{ emit @numeric, "NR", "k" }'
 1676 run_mlr --from $indir/abixy-het put -q 'for (k,v in $*) {if (is_string(v))   {@string[NR][k]  = v}}    end{ emit @string,  "NR", "k" }'
 1677 run_mlr --from $indir/abixy-het put -q 'for (k,v in $*) {if (is_bool(v))     {@bool[NR][k]    = v}}    end{ emit @bool,    "NR", "k" }'
 1678 run_mlr --from $indir/abixy-het put -q 'for (k,v in $*) {if (is_bool(NR==2)) {@bool[NR][k]    = "NR==2"}} end{ emit @bool,    "NR", "k" }'
 1679 
 1680 # ----------------------------------------------------------------
 1681 announce DSL TYPE-INFERENCE
 1682 
 1683 run_mlr --xtab put       '$y     = $pi1 + $pi2' $indir/mixed-types.xtab
 1684 run_mlr --xtab put    -F '$y     = $pi1 + $pi2' $indir/mixed-types.xtab
 1685 run_mlr --xtab put    -S '$y     = $pi1 . $pi2' $indir/mixed-types.xtab
 1686 run_mlr --xtab filter    '999   != $pi1 + $pi2' $indir/mixed-types.xtab
 1687 run_mlr --xtab filter -F '999   != $pi1 + $pi2' $indir/mixed-types.xtab
 1688 run_mlr --xtab filter -S '"999" != $pi1 . $pi2' $indir/mixed-types.xtab
 1689 
 1690 echo a=1,b=2.0 | run_mlr --oxtab put    '$s = $a; $t = $b; $u = 3; $v = 4.0; $ts=typeof($s); $tt=typeof($t); $tu=typeof($u); $tv=typeof($v);'
 1691 echo a=1,b=2.0 | run_mlr --oxtab put -F '$s = $a; $t = $b; $u = 3; $v = 4.0; $ts=typeof($s); $tt=typeof($t); $tu=typeof($u); $tv=typeof($v);'
 1692 echo a=1,b=2.0 | run_mlr --oxtab put -S '$s = $a; $t = $b; $u = 3; $v = 4.0; $ts=typeof($s); $tt=typeof($t); $tu=typeof($u); $tv=typeof($v);'
 1693 
 1694 run_mlr --xtab put    '$y=abs($pf1)' $indir/mixed-types.xtab
 1695 run_mlr --xtab put    '$y=abs($nf1)' $indir/mixed-types.xtab
 1696 run_mlr --xtab put    '$y=abs($zf)'  $indir/mixed-types.xtab
 1697 run_mlr --xtab put    '$y=abs($pi1)' $indir/mixed-types.xtab
 1698 run_mlr --xtab put    '$y=abs($ni1)' $indir/mixed-types.xtab
 1699 run_mlr --xtab put    '$y=abs($zi)'  $indir/mixed-types.xtab
 1700 
 1701 run_mlr --xtab put -F '$y=abs($pf1)' $indir/mixed-types.xtab
 1702 run_mlr --xtab put -F '$y=abs($nf1)' $indir/mixed-types.xtab
 1703 run_mlr --xtab put -F '$y=abs($zf)'  $indir/mixed-types.xtab
 1704 run_mlr --xtab put -F '$y=abs($pi1)' $indir/mixed-types.xtab
 1705 run_mlr --xtab put -F '$y=abs($ni1)' $indir/mixed-types.xtab
 1706 run_mlr --xtab put -F '$y=abs($zi)'  $indir/mixed-types.xtab
 1707 
 1708 run_mlr --xtab put    '$y=ceil($pf1)' $indir/mixed-types.xtab
 1709 run_mlr --xtab put    '$y=ceil($nf1)' $indir/mixed-types.xtab
 1710 run_mlr --xtab put    '$y=ceil($zf)'  $indir/mixed-types.xtab
 1711 run_mlr --xtab put    '$y=ceil($pi1)' $indir/mixed-types.xtab
 1712 run_mlr --xtab put    '$y=ceil($ni1)' $indir/mixed-types.xtab
 1713 run_mlr --xtab put    '$y=ceil($zi)'  $indir/mixed-types.xtab
 1714 
 1715 run_mlr --xtab put -F '$y=floor($pf1)' $indir/mixed-types.xtab
 1716 run_mlr --xtab put -F '$y=floor($nf1)' $indir/mixed-types.xtab
 1717 run_mlr --xtab put -F '$y=floor($zf)'  $indir/mixed-types.xtab
 1718 run_mlr --xtab put -F '$y=floor($pi1)' $indir/mixed-types.xtab
 1719 run_mlr --xtab put -F '$y=floor($ni1)' $indir/mixed-types.xtab
 1720 run_mlr --xtab put -F '$y=floor($zi)'  $indir/mixed-types.xtab
 1721 
 1722 run_mlr --xtab put    '$y=round($pf1)' $indir/mixed-types.xtab
 1723 run_mlr --xtab put    '$y=round($nf1)' $indir/mixed-types.xtab
 1724 run_mlr --xtab put    '$y=round($zf)'  $indir/mixed-types.xtab
 1725 run_mlr --xtab put    '$y=round($pi1)' $indir/mixed-types.xtab
 1726 run_mlr --xtab put    '$y=round($ni1)' $indir/mixed-types.xtab
 1727 run_mlr --xtab put    '$y=round($zi)'  $indir/mixed-types.xtab
 1728 
 1729 run_mlr --xtab put -F '$y=round($pf1)' $indir/mixed-types.xtab
 1730 run_mlr --xtab put -F '$y=round($nf1)' $indir/mixed-types.xtab
 1731 run_mlr --xtab put -F '$y=round($zf)'  $indir/mixed-types.xtab
 1732 run_mlr --xtab put -F '$y=round($pi1)' $indir/mixed-types.xtab
 1733 run_mlr --xtab put -F '$y=round($ni1)' $indir/mixed-types.xtab
 1734 run_mlr --xtab put -F '$y=round($zi)'  $indir/mixed-types.xtab
 1735 
 1736 run_mlr --xtab put    '$y=sgn($pf1)' $indir/mixed-types.xtab
 1737 run_mlr --xtab put    '$y=sgn($nf1)' $indir/mixed-types.xtab
 1738 run_mlr --xtab put    '$y=sgn($zf)'  $indir/mixed-types.xtab
 1739 run_mlr --xtab put    '$y=sgn($pi1)' $indir/mixed-types.xtab
 1740 run_mlr --xtab put    '$y=sgn($ni1)' $indir/mixed-types.xtab
 1741 run_mlr --xtab put    '$y=sgn($zi)'  $indir/mixed-types.xtab
 1742 
 1743 run_mlr --xtab put -F '$y=sgn($pf1)' $indir/mixed-types.xtab
 1744 run_mlr --xtab put -F '$y=sgn($nf1)' $indir/mixed-types.xtab
 1745 run_mlr --xtab put -F '$y=sgn($zf)'  $indir/mixed-types.xtab
 1746 run_mlr --xtab put -F '$y=sgn($pi1)' $indir/mixed-types.xtab
 1747 run_mlr --xtab put -F '$y=sgn($ni1)' $indir/mixed-types.xtab
 1748 run_mlr --xtab put -F '$y=sgn($zi)'  $indir/mixed-types.xtab
 1749 
 1750 run_mlr --xtab put    '$min=min($pf1,$pf2);$max=max($pf1,$pf2)' $indir/mixed-types.xtab
 1751 run_mlr --xtab put    '$min=min($pf1,$pi2);$max=max($pf1,$pi2)' $indir/mixed-types.xtab
 1752 run_mlr --xtab put    '$min=min($pi1,$pf2);$max=max($pi1,$pf2)' $indir/mixed-types.xtab
 1753 run_mlr --xtab put    '$min=min($pi1,$pi2);$max=max($pi1,$pi2)' $indir/mixed-types.xtab
 1754 
 1755 run_mlr --xtab put -F '$min=min($pf1,$pf2);$max=max($pf1,$pf2)' $indir/mixed-types.xtab
 1756 run_mlr --xtab put -F '$min=min($pf1,$pi2);$max=max($pf1,$pi2)' $indir/mixed-types.xtab
 1757 run_mlr --xtab put -F '$min=min($pi1,$pf2);$max=max($pi1,$pf2)' $indir/mixed-types.xtab
 1758 run_mlr --xtab put -F '$min=min($pi1,$pi2);$max=max($pi1,$pi2)' $indir/mixed-types.xtab
 1759 
 1760 run_mlr --xtab put    '$min=min($pf1,$pf2);$max=max($pf1,$pf2)' $indir/mixed-types.xtab
 1761 run_mlr --xtab put    '$min=min($pf1,$pi2);$max=max($pf1,$pi2)' $indir/mixed-types.xtab
 1762 run_mlr --xtab put    '$min=min($pi1,$pf2);$max=max($pi1,$pf2)' $indir/mixed-types.xtab
 1763 run_mlr --xtab put    '$min=min($pi1,$pi2);$max=max($pi1,$pi2)' $indir/mixed-types.xtab
 1764 
 1765 run_mlr --xtab put -F '$min=min($pf1,$pf2);$max=max($pf1,$pf2)' $indir/mixed-types.xtab
 1766 run_mlr --xtab put -F '$min=min($pf1,$pi2);$max=max($pf1,$pi2)' $indir/mixed-types.xtab
 1767 run_mlr --xtab put -F '$min=min($pi1,$pf2);$max=max($pi1,$pf2)' $indir/mixed-types.xtab
 1768 run_mlr --xtab put -F '$min=min($pi1,$pi2);$max=max($pi1,$pi2)' $indir/mixed-types.xtab
 1769 
 1770 run_mlr --xtab put    '$sum=$pf1+$pf2;$diff=$pf1-$pf2' $indir/mixed-types.xtab
 1771 run_mlr --xtab put    '$sum=$pf1+$pi2;$diff=$pf1-$pi2' $indir/mixed-types.xtab
 1772 run_mlr --xtab put    '$sum=$pi1+$pf2;$diff=$pi1-$pf2' $indir/mixed-types.xtab
 1773 run_mlr --xtab put    '$sum=$pi1+$pi2;$diff=$pi1-$pi2' $indir/mixed-types.xtab
 1774 
 1775 run_mlr --xtab put -F '$sum=$pf1+$pf2;$diff=$pf1-$pf2' $indir/mixed-types.xtab
 1776 run_mlr --xtab put -F '$sum=$pf1+$pi2;$diff=$pf1-$pi2' $indir/mixed-types.xtab
 1777 run_mlr --xtab put -F '$sum=$pi1+$pf2;$diff=$pi1-$pf2' $indir/mixed-types.xtab
 1778 run_mlr --xtab put -F '$sum=$pi1+$pi2;$diff=$pi1-$pi2' $indir/mixed-types.xtab
 1779 
 1780 run_mlr --xtab put    '$prod=$pf1*$pf2;$quot=$pf1/$pf2' $indir/mixed-types.xtab
 1781 run_mlr --xtab put    '$prod=$pf1*$pi2;$quot=$pf1/$pi2' $indir/mixed-types.xtab
 1782 run_mlr --xtab put    '$prod=$pi1*$pf2;$quot=$pi1/$pf2' $indir/mixed-types.xtab
 1783 run_mlr --xtab put    '$prod=$pi1*$pi2;$quot=$pi1/$pi2' $indir/mixed-types.xtab
 1784 
 1785 run_mlr --xtab put -F '$prod=$pf1*$pf2;$quot=$pf1/$pf2' $indir/mixed-types.xtab
 1786 run_mlr --xtab put -F '$prod=$pf1*$pi2;$quot=$pf1/$pi2' $indir/mixed-types.xtab
 1787 run_mlr --xtab put -F '$prod=$pi1*$pf2;$quot=$pi1/$pf2' $indir/mixed-types.xtab
 1788 run_mlr --xtab put -F '$prod=$pi1*$pi2;$quot=$pi1/$pi2' $indir/mixed-types.xtab
 1789 
 1790 run_mlr --xtab put    '$iquot=$pf1//$pf2;$mod=$pf1%$pf2' $indir/mixed-types.xtab
 1791 run_mlr --xtab put    '$iquot=$pf1//$pi2;$mod=$pf1%$pi2' $indir/mixed-types.xtab
 1792 run_mlr --xtab put    '$iquot=$pi1//$pf2;$mod=$pi1%$pf2' $indir/mixed-types.xtab
 1793 run_mlr --xtab put    '$iquot=$pi1//$pi2;$mod=$pi1%$pi2' $indir/mixed-types.xtab
 1794 
 1795 run_mlr --xtab put -F '$iquot=$pf1//$pf2;$mod=$pf1%$pf2' $indir/mixed-types.xtab
 1796 run_mlr --xtab put -F '$iquot=$pf1//$pi2;$mod=$pf1%$pi2' $indir/mixed-types.xtab
 1797 run_mlr --xtab put -F '$iquot=$pi1//$pf2;$mod=$pi1%$pf2' $indir/mixed-types.xtab
 1798 run_mlr --xtab put -F '$iquot=$pi1//$pi2;$mod=$pi1%$pi2' $indir/mixed-types.xtab
 1799 
 1800 run_mlr --xtab put    '$a=roundm($pf1,10.0);$b=roundm($pf1,-10.0)' $indir/mixed-types.xtab
 1801 run_mlr --xtab put    '$a=roundm($pf1,10)  ;$b=roundm($pf1,-10)  ' $indir/mixed-types.xtab
 1802 run_mlr --xtab put    '$a=roundm($pi1,10.0);$b=roundm($pi1,-10.0)' $indir/mixed-types.xtab
 1803 run_mlr --xtab put    '$a=roundm($pi1,10)  ;$b=roundm($pi1,-10)  ' $indir/mixed-types.xtab
 1804 
 1805 echo 'x=3,y=4' | run_mlr --oxtab put '$z=$x+$y; $a=3+4; $b="3"."4"; $c="3"+4'
 1806 
 1807 # ----------------------------------------------------------------
 1808 announce DSL SCIENTIFIC NOTATION IN FIELD VALUES
 1809 
 1810 run_mlr --opprint put '$y=$x+1' $indir/scinot.dkvp
 1811 
 1812 # ----------------------------------------------------------------
 1813 announce DSL SCIENTIFIC NOTATION IN EXPRESSION LITERALS
 1814 
 1815 run_mlr --opprint put '$y = 123     + $i' $indir/scinot1.dkvp
 1816 run_mlr --opprint put '$y = 123.    + $i' $indir/scinot1.dkvp
 1817 run_mlr --opprint put '$y = 123.4   + $i' $indir/scinot1.dkvp
 1818 run_mlr --opprint put '$y = .234    + $i' $indir/scinot1.dkvp
 1819 run_mlr --opprint put '$y = 1e2     + $i' $indir/scinot1.dkvp
 1820 run_mlr --opprint put '$y = 1e-2    + $i' $indir/scinot1.dkvp
 1821 run_mlr --opprint put '$y = 1.2e3   + $i' $indir/scinot1.dkvp
 1822 run_mlr --opprint put '$y = 1.e3    + $i' $indir/scinot1.dkvp
 1823 run_mlr --opprint put '$y = 1.2e-3  + $i' $indir/scinot1.dkvp
 1824 run_mlr --opprint put '$y = 1.e-3   + $i' $indir/scinot1.dkvp
 1825 run_mlr --opprint put '$y = .2e3    + $i' $indir/scinot1.dkvp
 1826 run_mlr --opprint put '$y = .2e-3   + $i' $indir/scinot1.dkvp
 1827 run_mlr --opprint put '$y = 1.e-3   + $i' $indir/scinot1.dkvp
 1828 run_mlr --opprint put '$y = -123    + $i' $indir/scinot1.dkvp
 1829 run_mlr --opprint put '$y = -123.   + $i' $indir/scinot1.dkvp
 1830 run_mlr --opprint put '$y = -123.4  + $i' $indir/scinot1.dkvp
 1831 run_mlr --opprint put '$y = -.234   + $i' $indir/scinot1.dkvp
 1832 run_mlr --opprint put '$y = -1e2    + $i' $indir/scinot1.dkvp
 1833 run_mlr --opprint put '$y = -1e-2   + $i' $indir/scinot1.dkvp
 1834 run_mlr --opprint put '$y = -1.2e3  + $i' $indir/scinot1.dkvp
 1835 run_mlr --opprint put '$y = -1.e3   + $i' $indir/scinot1.dkvp
 1836 run_mlr --opprint put '$y = -1.2e-3 + $i' $indir/scinot1.dkvp
 1837 run_mlr --opprint put '$y = -1.e-3  + $i' $indir/scinot1.dkvp
 1838 run_mlr --opprint put '$y = -.2e3   + $i' $indir/scinot1.dkvp
 1839 run_mlr --opprint put '$y = -.2e-3  + $i' $indir/scinot1.dkvp
 1840 run_mlr --opprint put '$y = -1.e-3  + $i' $indir/scinot1.dkvp
 1841 
 1842 # ----------------------------------------------------------------
 1843 announce DSL FROM-FILE FEATURE
 1844 
 1845 run_mlr put    -f $indir/put-example.dsl $indir/abixy
 1846 run_mlr filter -f $indir/filter-example.dsl $indir/abixy
 1847 
 1848 run_mlr --from $indir/abixy put    -f $indir/put-example.dsl
 1849 run_mlr --from $indir/abixy filter -f $indir/filter-example.dsl
 1850 
 1851 run_mlr --from $indir/abixy --from $indir/abixy-het put    -f $indir/put-example.dsl
 1852 run_mlr --from $indir/abixy --from $indir/abixy-het filter -f $indir/filter-example.dsl
 1853 
 1854 # ----------------------------------------------------------------
 1855 announce DSL MULTI-PART SCRIPTS
 1856 
 1857 run_mlr --opprint --from $indir/abixy put -f $indir/put-script-piece-1
 1858 run_mlr --opprint --from $indir/abixy put -f $indir/put-script-piece-1 -f $indir/put-script-piece-2
 1859 run_mlr --opprint --from $indir/abixy put -f $indir/put-script-piece-1 -f $indir/put-script-piece-2 -f $indir/put-script-piece-3
 1860 
 1861 run_mlr --opprint --from $indir/abixy put -e '$xy = $x**2 + $y**2'
 1862 run_mlr --opprint --from $indir/abixy filter -e 'NR == 7'
 1863 
 1864 run_mlr --opprint --from $indir/abixy put -e 'print "PRE";' -f $indir/put-script-piece-1 -f $indir/put-script-piece-2 -f $indir/put-script-piece-3 -e 'print "POST"'
 1865 
 1866 run_mlr --opprint --from $indir/abixy filter -f $indir/filter-script-piece-1
 1867 run_mlr --opprint --from $indir/abixy filter -f $indir/filter-script-piece-1 -f $indir/filter-script-piece-2
 1868 
 1869 # ----------------------------------------------------------------
 1870 announce UTF-8 STRLEN
 1871 
 1872 run_mlr --inidx --ifs comma --oxtab put '$s1=strlen($1);$s2=strlen($2);$s3=strlen($3);$s4=strlen($4)' $indir/utf8-align.dkvp
 1873 
 1874 # ----------------------------------------------------------------
 1875 announce STATS1/STEP INT/FLOAT
 1876 
 1877 run_mlr --opprint step      -a rsum,delta,counter  -f x,y,z $indir/int-float.dkvp
 1878 run_mlr --opprint step   -F -a rsum,delta,counter  -f x,y,z $indir/int-float.dkvp
 1879 run_mlr --oxtab   stats1    -a min,max,sum,count   -f x,y,z $indir/int-float.dkvp
 1880 run_mlr --oxtab   stats1 -F -a min,max,sum,count   -f x,y,z $indir/int-float.dkvp
 1881 
 1882 # ----------------------------------------------------------------
 1883 announce DSL PYTHONIC DIVISION
 1884 
 1885 run_mlr --xtab put    '$quot=$pf1/10.0;$iquot=$pf1//10.0;$mod=$pf1%10.0' $indir/mixed-types.xtab
 1886 run_mlr --xtab put    '$quot=$pi1/10  ;$iquot=$pi1//10  ;$mod=$pi1%10  ' $indir/mixed-types.xtab
 1887 run_mlr --xtab put    '$quot=$nf1/10.0;$iquot=$nf1//10.0;$mod=$nf1%10.0' $indir/mixed-types.xtab
 1888 run_mlr --xtab put    '$quot=$ni1/10  ;$iquot=$ni1//10  ;$mod=$ni1%10  ' $indir/mixed-types.xtab
 1889 run_mlr --xtab put -F '$quot=$pf1/10.0;$iquot=$pf1//10.0;$mod=$pf1%10.0' $indir/mixed-types.xtab
 1890 run_mlr --xtab put -F '$quot=$pi1/10  ;$iquot=$pi1//10  ;$mod=$pi1%10  ' $indir/mixed-types.xtab
 1891 run_mlr --xtab put -F '$quot=$nf1/10.0;$iquot=$nf1//10.0;$mod=$nf1%10.0' $indir/mixed-types.xtab
 1892 run_mlr --xtab put -F '$quot=$ni1/10  ;$iquot=$ni1//10  ;$mod=$ni1%10  ' $indir/mixed-types.xtab
 1893 
 1894 run_mlr --xtab put    '$quot=$pf1/-10.0;$iquot=$pf1//-10.0;$mod=$pf1%-10.0' $indir/mixed-types.xtab
 1895 run_mlr --xtab put    '$quot=$pi1/-10  ;$iquot=$pi1//-10  ;$mod=$pi1%-10  ' $indir/mixed-types.xtab
 1896 run_mlr --xtab put    '$quot=$nf1/-10.0;$iquot=$nf1//-10.0;$mod=$nf1%-10.0' $indir/mixed-types.xtab
 1897 run_mlr --xtab put    '$quot=$ni1/-10  ;$iquot=$ni1//-10  ;$mod=$ni1%-10  ' $indir/mixed-types.xtab
 1898 run_mlr --xtab put -F '$quot=$pf1/-10.0;$iquot=$pf1//-10.0;$mod=$pf1%-10.0' $indir/mixed-types.xtab
 1899 run_mlr --xtab put -F '$quot=$pi1/-10  ;$iquot=$pi1//-10  ;$mod=$pi1%-10  ' $indir/mixed-types.xtab
 1900 run_mlr --xtab put -F '$quot=$nf1/-10.0;$iquot=$nf1//-10.0;$mod=$nf1%-10.0' $indir/mixed-types.xtab
 1901 run_mlr --xtab put -F '$quot=$ni1/-10  ;$iquot=$ni1//-10  ;$mod=$ni1%-10  ' $indir/mixed-types.xtab
 1902 
 1903 # ----------------------------------------------------------------
 1904 announce DSL REGEX MATCHING
 1905 
 1906 run_mlr filter -v '$x =~ "bcd"'       $indir/regex.dkvp
 1907 run_mlr filter -v '$x =~ "^bcd"'      $indir/regex.dkvp
 1908 run_mlr filter -v '$x =~ "^abc"'      $indir/regex.dkvp
 1909 run_mlr filter -v '$x =~ "^abc$"'     $indir/regex.dkvp
 1910 run_mlr filter -v '$x =~ "^a.*d$"'    $indir/regex.dkvp
 1911 run_mlr filter -v '$x =~ "^a.*"."d$"' $indir/regex.dkvp
 1912 run_mlr filter -v '$y =~ "\".."'      $indir/regex.dkvp
 1913 
 1914 run_mlr filter -v '$x =~ "bcd"i'       $indir/regex.dkvp
 1915 run_mlr filter -v '$x =~ "^bcd"i'      $indir/regex.dkvp
 1916 run_mlr filter -v '$x =~ "^abc"i'      $indir/regex.dkvp
 1917 run_mlr filter -v '$x =~ "^abc$"i'     $indir/regex.dkvp
 1918 run_mlr filter -v '$x =~ "^a.*d$"i'    $indir/regex.dkvp
 1919 run_mlr filter -v '$x =~ "^a.*"."d$"i' $indir/regex.dkvp
 1920 
 1921 run_mlr --csv filter '$text =~ "."'    $indir/dot-match.csv
 1922 run_mlr --csv filter '$text =~ "\."'   $indir/dot-match.csv
 1923 
 1924 # ----------------------------------------------------------------
 1925 announce DSL TYPED OVERLAY
 1926 
 1927 run_mlr put '$y = string($x); $z=$y.$y' $indir/int-float.dkvp
 1928 run_mlr put '$z=string($x).string($x)' $indir/int-float.dkvp
 1929 run_mlr put '$y = string($x)' then put '$z=$y.$y' $indir/int-float.dkvp
 1930 run_mlr put '$a="hello"' then put '$b=$a." world";$z=$x+$y;$c=$b;$a=sub($b,"hello","farewell")' $indir/int-float.dkvp
 1931 
 1932 # ----------------------------------------------------------------
 1933 announce DSL REGEX CAPTURES
 1934 
 1935 # cat reg_test/input/capture.dkvp
 1936 # FIELD=ABC123
 1937 # FIELD=ABC..123
 1938 # FIELD=..ABC..123..
 1939 # FIELD=none of the above
 1940 
 1941 run_mlr --opprint put '$FIELD =~ "([A-Z]+)([0-9]+)";         $F1="\1"; $F2="\2"; $F3="\3"' $indir/capture.dkvp
 1942 run_mlr --opprint put '$FIELD =~ "([A-Z]+)[^0-9]*([0-9]+)";  $F1="\1"; $F2="\2"; $F3="\3"' $indir/capture.dkvp
 1943 
 1944 run_mlr --opprint put '$FIELD =~ "([A-Z]+)([0-9]+)"'         then put '$F1="\1"; $F2="\2"; $F3="\3"' $indir/capture.dkvp
 1945 run_mlr --opprint put '$FIELD =~ "([A-Z]+)[^0-9]*([0-9]+)"'  then put '$F1="\1"; $F2="\2"; $F3="\3"' $indir/capture.dkvp
 1946 
 1947 # cat reg_test/input/capture-lengths.dkvp
 1948 # FIELD=
 1949 # FIELD=a
 1950 # FIELD=ab
 1951 # FIELD=abc
 1952 # FIELD=abcd
 1953 # FIELD=abcde
 1954 # FIELD=abcdef
 1955 # FIELD=abcdefg
 1956 # FIELD=abcdefgh
 1957 # FIELD=abcdefghi
 1958 # FIELD=abcdefghij
 1959 # FIELD=abcdefghijk
 1960 # FIELD=abcdefghijkl
 1961 
 1962 run_mlr --opprint put '       $FIELD =~ "....."; $F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"'  $indir/capture-lengths.dkvp
 1963 run_mlr --opprint put '       $FIELD =~ "....." {$F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"}' $indir/capture-lengths.dkvp
 1964 run_mlr --opprint put 'filter $FIELD =~ "....."; $F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"'  $indir/capture-lengths.dkvp
 1965 
 1966 run_mlr --opprint put '$FIELD =~ "(.)";                            $F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"' $indir/capture-lengths.dkvp
 1967 run_mlr --opprint put '$FIELD =~ "(.)(.)";                         $F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"' $indir/capture-lengths.dkvp
 1968 run_mlr --opprint put '$FIELD =~ "(.)(.)(.)";                      $F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"' $indir/capture-lengths.dkvp
 1969 run_mlr --opprint put '$FIELD =~ "(.)(.)(.)(.)";                   $F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"' $indir/capture-lengths.dkvp
 1970 run_mlr --opprint put '$FIELD =~ "(.)(.)(.)(.)(.)";                $F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"' $indir/capture-lengths.dkvp
 1971 run_mlr --opprint put '$FIELD =~ "(.)(.)(.)(.)(.)(.)";             $F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"' $indir/capture-lengths.dkvp
 1972 run_mlr --opprint put '$FIELD =~ "(.)(.)(.)(.)(.)(.)(.)";          $F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"' $indir/capture-lengths.dkvp
 1973 run_mlr --opprint put '$FIELD =~ "(.)(.)(.)(.)(.)(.)(.)(.)";       $F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"' $indir/capture-lengths.dkvp
 1974 run_mlr --opprint put '$FIELD =~ "(.)(.)(.)(.)(.)(.)(.)(.)(.)";    $F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"' $indir/capture-lengths.dkvp
 1975 run_mlr --opprint put '$FIELD =~ "(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)"; $F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"' $indir/capture-lengths.dkvp
 1976 
 1977 run_mlr --opprint put '$FIELD =~ "(.)"                            {$F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"}' $indir/capture-lengths.dkvp
 1978 run_mlr --opprint put '$FIELD =~ "(.)(.)"                         {$F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"}' $indir/capture-lengths.dkvp
 1979 run_mlr --opprint put '$FIELD =~ "(.)(.)(.)"                      {$F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"}' $indir/capture-lengths.dkvp
 1980 run_mlr --opprint put '$FIELD =~ "(.)(.)(.)(.)"                   {$F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"}' $indir/capture-lengths.dkvp
 1981 run_mlr --opprint put '$FIELD =~ "(.)(.)(.)(.)(.)"                {$F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"}' $indir/capture-lengths.dkvp
 1982 run_mlr --opprint put '$FIELD =~ "(.)(.)(.)(.)(.)(.)"             {$F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"}' $indir/capture-lengths.dkvp
 1983 run_mlr --opprint put '$FIELD =~ "(.)(.)(.)(.)(.)(.)(.)"          {$F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"}' $indir/capture-lengths.dkvp
 1984 run_mlr --opprint put '$FIELD =~ "(.)(.)(.)(.)(.)(.)(.)(.)"       {$F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"}' $indir/capture-lengths.dkvp
 1985 run_mlr --opprint put '$FIELD =~ "(.)(.)(.)(.)(.)(.)(.)(.)(.)"    {$F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"}' $indir/capture-lengths.dkvp
 1986 run_mlr --opprint put '$FIELD =~ "(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)" {$F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"}' $indir/capture-lengths.dkvp
 1987 
 1988 run_mlr --opprint put 'filter $FIELD =~ "(.)";                            $F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"' $indir/capture-lengths.dkvp
 1989 run_mlr --opprint put 'filter $FIELD =~ "(.)(.)";                         $F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"' $indir/capture-lengths.dkvp
 1990 run_mlr --opprint put 'filter $FIELD =~ "(.)(.)(.)";                      $F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"' $indir/capture-lengths.dkvp
 1991 run_mlr --opprint put 'filter $FIELD =~ "(.)(.)(.)(.)";                   $F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"' $indir/capture-lengths.dkvp
 1992 run_mlr --opprint put 'filter $FIELD =~ "(.)(.)(.)(.)(.)";                $F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"' $indir/capture-lengths.dkvp
 1993 run_mlr --opprint put 'filter $FIELD =~ "(.)(.)(.)(.)(.)(.)";             $F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"' $indir/capture-lengths.dkvp
 1994 run_mlr --opprint put 'filter $FIELD =~ "(.)(.)(.)(.)(.)(.)(.)";          $F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"' $indir/capture-lengths.dkvp
 1995 run_mlr --opprint put 'filter $FIELD =~ "(.)(.)(.)(.)(.)(.)(.)(.)";       $F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"' $indir/capture-lengths.dkvp
 1996 run_mlr --opprint put 'filter $FIELD =~ "(.)(.)(.)(.)(.)(.)(.)(.)(.)";    $F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"' $indir/capture-lengths.dkvp
 1997 run_mlr --opprint put 'filter $FIELD =~ "(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)"; $F0="\0";$F1="\1";$F2="\2";$F3="\3";$F4="\4";$F5="\5";$F6="\6";$F7="\7";$F8="\8";$F9="\9"' $indir/capture-lengths.dkvp
 1998 
 1999 echo 'abcdefg' | run_mlr --inidx --odkvp put '$1 =~ "ab(.)d(..)g"  { $c1 = "\1"; $c2 = "\2"}'
 2000 echo 'abcdefg' | run_mlr --inidx --odkvp put '$1 =~ "ab(.)?d(..)g" { $c1 = "\1"; $c2 = "\2"}'
 2001 echo 'abXdefg' | run_mlr --inidx --odkvp put '$1 =~ "ab(c)?d(..)g" { $c1 = "\1"; $c2 = "\2"}'
 2002 echo 'abdefg'  | run_mlr --inidx --odkvp put '$1 =~ "ab(c)?d(..)g" { $c1 = "\1"; $c2 = "\2"}'
 2003 
 2004 # ----------------------------------------------------------------
 2005 announce DSL FILTER/PATTERN-ACTION
 2006 
 2007 run_mlr --opprint put '         $x > 0.5;  $z = "flag"'  $indir/abixy
 2008 run_mlr --opprint put '       !($x > 0.5); $z = "flag"'  $indir/abixy
 2009 run_mlr --opprint put 'filter   $x > 0.5;  $z = "flag"'  $indir/abixy
 2010 run_mlr --opprint put '         $x > 0.5  {$z = "flag"}' $indir/abixy
 2011 run_mlr --opprint put 'filter !($x > 0.5); $z = "flag"'  $indir/abixy
 2012 run_mlr --opprint put '       !($x > 0.5) {$z = "flag"}' $indir/abixy
 2013 
 2014 # ----------------------------------------------------------------
 2015 announce DSL GMT DATE/TIME FUNCTIONS
 2016 
 2017 run_mlr --csvlite put '$gmt = sec2gmt($sec)' $indir/sec2gmt
 2018 run_mlr --csvlite put '$gmt = sec2gmt($sec,1)' $indir/sec2gmt
 2019 run_mlr --csvlite put '$gmt = sec2gmt($sec,3)' $indir/sec2gmt
 2020 run_mlr --csvlite put '$gmt = sec2gmt($sec,6)' $indir/sec2gmt
 2021 run_mlr --csvlite put '$sec = gmt2sec($gmt)' $indir/gmt2sec
 2022 run_mlr --csvlite put '$gmtdate = sec2gmtdate($sec)' $indir/sec2gmt
 2023 
 2024 run_mlr --icsv --opprint put '$gmt = strftime($sec, "%Y-%m-%dT%H:%M:%SZ")'  $indir/sec2gmt
 2025 run_mlr --icsv --opprint put '$gmt = strftime($sec, "%Y-%m-%dT%H:%M:%1SZ")' $indir/sec2gmt
 2026 run_mlr --icsv --opprint put '$gmt = strftime($sec, "%Y-%m-%dT%H:%M:%3SZ")' $indir/sec2gmt
 2027 run_mlr --icsv --opprint put '$gmt = strftime($sec, "%Y-%m-%dT%H:%M:%6SZ")' $indir/sec2gmt
 2028 run_mlr --icsv --opprint put '$sec = strptime($gmt, "%Y-%m-%dT%H:%M:%SZ")'  $indir/gmt2sec
 2029 
 2030 run_mlr --csvlite sec2gmt sec $indir/sec2gmt
 2031 
 2032 run_mlr --opprint put '$hms=sec2hms($sec);   $resec=hms2sec($hms);   $diff=$resec-$sec' $indir/sec2xhms
 2033 run_mlr --opprint put '$hms=fsec2hms($sec);  $resec=hms2fsec($hms);  $diff=$resec-$sec' $indir/fsec2xhms
 2034 run_mlr --opprint put '$hms=sec2dhms($sec);  $resec=dhms2sec($hms);  $diff=$resec-$sec' $indir/sec2xhms
 2035 run_mlr --opprint put '$hms=fsec2dhms($sec); $resec=dhms2fsec($hms); $diff=$resec-$sec' $indir/fsec2xhms
 2036 
 2037 run_mlr --csvlite sec2gmt     sec $indir/sec2gmt
 2038 run_mlr --csvlite sec2gmtdate sec $indir/sec2gmt
 2039 
 2040 # ----------------------------------------------------------------
 2041 announce DSL LOCAL DATE/TIME FUNCTIONS
 2042 
 2043 # See also the system date command:
 2044 # export TZ=America/Sao_Paulo; date -j -f "%Y-%m-%d %H:%M:%S %Z" "2017-02-19 00:30:00" +%s
 2045 # export TZ=America/Sao_Paulo; date -r  86400 +"%Y-%m-%d %H:%M:%S %Z"
 2046 
 2047 export TZ=America/Sao_Paulo
 2048 echo TZ=$TZ
 2049 run_mlr --opprint put '$b=localtime2sec($a); $c=sec2localtime($b); $d=sec2localdate($b)' <<_EOF
 2050 a=2017-02-18 23:00:00
 2051 a=2017-02-18 23:59:59
 2052 a=2017-02-19 00:00:00
 2053 a=2017-02-19 00:30:00
 2054 a=2017-02-19 01:00:00
 2055 a=2017-10-14 23:00:00
 2056 a=2017-10-14 23:59:59
 2057 a=2017-10-15 00:00:00
 2058 a=2017-10-15 00:30:00
 2059 a=2017-10-15 01:00:00
 2060 _EOF
 2061 export TZ=
 2062 
 2063 export TZ=America/Sao_Paulo
 2064 echo TZ=$TZ
 2065 run_mlr --opprint put '$b=localtime2sec($a); $c=sec2localtime($b); $d=sec2localdate($b)' <<_EOF
 2066 a=2017-02-14 00:00:00
 2067 a=2017-02-15 00:00:00
 2068 a=2017-02-16 00:00:00
 2069 a=2017-02-17 00:00:00
 2070 a=2017-02-18 00:00:00
 2071 a=2017-02-19 00:00:00
 2072 a=2017-02-20 00:00:00
 2073 a=2017-10-12 00:00:00
 2074 a=2017-10-13 00:00:00
 2075 a=2017-10-14 00:00:00
 2076 a=2017-10-15 00:00:00
 2077 a=2017-10-16 00:00:00
 2078 a=2017-10-17 00:00:00
 2079 a=2017-10-18 00:00:00
 2080 a=2017-10-19 00:00:00
 2081 _EOF
 2082 export TZ=
 2083 
 2084 export TZ=America/Sao_Paulo
 2085 echo TZ=$TZ
 2086 run_mlr --opprint put '$b=strptime_local($a, "%Y-%m-%d %H:%M:%S"); $c=strftime_local($b, "%Y-%m-%d %H:%M:%S")' <<_EOF
 2087 a=2017-02-18 23:00:00
 2088 a=2017-02-18 23:59:59
 2089 a=2017-02-19 00:00:00
 2090 a=2017-02-19 00:30:00
 2091 a=2017-02-19 01:00:00
 2092 a=2017-10-14 23:00:00
 2093 a=2017-10-14 23:59:59
 2094 a=2017-10-15 00:00:00
 2095 a=2017-10-15 00:30:00
 2096 a=2017-10-15 01:00:00
 2097 _EOF
 2098 export TZ=
 2099 
 2100 export TZ=America/Sao_Paulo
 2101 echo TZ=$TZ
 2102 run_mlr --opprint put '$b=strptime_local($a, "%Y-%m-%d %H:%M:%S"); $c=strftime_local($b, "%Y-%m-%d %H:%M:%S")' <<_EOF
 2103 a=2017-02-18 23:00:00
 2104 a=2017-02-18 23:59:59
 2105 a=2017-02-19 00:00:00
 2106 a=2017-02-19 00:30:00
 2107 a=2017-02-19 01:00:00
 2108 a=2017-10-14 23:00:00
 2109 a=2017-10-14 23:59:59
 2110 a=2017-10-15 00:00:00
 2111 a=2017-10-15 00:30:00
 2112 a=2017-10-15 01:00:00
 2113 _EOF
 2114 export TZ=
 2115 
 2116 # ----------------------------------------------------------------
 2117 announce DSL SUB/GSUB/REGEX_EXTRACT
 2118 
 2119 run_mlr --opprint put '$y = sub($x, "e.*l",        "")' $indir/sub.dat
 2120 run_mlr --opprint put '$y = sub($x, "e.*l"i,       "")' $indir/sub.dat
 2121 run_mlr --opprint put '$y = sub($x, "e.*"."l",     "")' $indir/sub.dat
 2122 run_mlr --opprint put '$y = sub($x, "e.*l",        "y123y")' $indir/sub.dat
 2123 run_mlr --opprint put '$y = sub($x, "e.*l"i,       "y123y")' $indir/sub.dat
 2124 run_mlr --opprint put '$y = sub($x, "e.*"."l",     "y123y")' $indir/sub.dat
 2125 run_mlr --opprint put '$y = sub($x, "([hg])e.*l(.)", "y\1y123\2y")' $indir/sub.dat
 2126 run_mlr --opprint put '$y = sub($x, "([hg])e.*l.",   "y\1y123\2y")' $indir/sub.dat
 2127 run_mlr --opprint put '$y = sub($x, "([hg])e.*l(.)", "y\1y123.y")'  $indir/sub.dat
 2128 
 2129 run_mlr --opprint put '$y = sub($x,  "a",    "aa")'   $indir/gsub.dat
 2130 run_mlr --opprint put '$y = gsub($x, "a",    "aa")'   $indir/gsub.dat
 2131 run_mlr --opprint put '$y = gsub($x, "A",    "Aa")'   $indir/gsub.dat
 2132 run_mlr --opprint put '$y = gsub($x, "a"i,   "Aa")'   $indir/gsub.dat
 2133 run_mlr --opprint put '$y = gsub($x, "A"i,   "Aa")'   $indir/gsub.dat
 2134 run_mlr --opprint put '$y = gsub($x, "a(.)", "aa\1\1\1")' $indir/gsub.dat
 2135 
 2136 run_mlr --opprint put '$y = sub($x,  "a",    "")'   $indir/gsub.dat
 2137 run_mlr --opprint put '$y = gsub($x, "a",    "")'   $indir/gsub.dat
 2138 run_mlr --opprint put '$y = gsub($x, "A",    "")'   $indir/gsub.dat
 2139 run_mlr --opprint put '$y = gsub($x, "a"i,   "")'   $indir/gsub.dat
 2140 run_mlr --opprint put '$y = gsub($x, "A"i,   "")'   $indir/gsub.dat
 2141 
 2142 run_mlr --oxtab cat                       $indir/subtab.dkvp
 2143 run_mlr --oxtab put -f $indir/subtab1.mlr $indir/subtab.dkvp
 2144 run_mlr --oxtab put -f $indir/subtab2.mlr $indir/subtab.dkvp
 2145 run_mlr --oxtab put -f $indir/subtab3.mlr $indir/subtab.dkvp
 2146 run_mlr --oxtab put -f $indir/subtab4.mlr $indir/subtab.dkvp
 2147 
 2148 run_mlr --opprint put '$y = ssub($x, "HE",       "")'           $indir/sub.dat
 2149 run_mlr --opprint put '$y = ssub($x, "HE",       "HE")'         $indir/sub.dat
 2150 run_mlr --opprint put '$y = ssub($x, "HE",       "12345")'      $indir/sub.dat
 2151 run_mlr --opprint put '$y = ssub($x, "LL",       "1")'          $indir/sub.dat
 2152 run_mlr --opprint put '$y = ssub($x, "LL",       "12")'         $indir/sub.dat
 2153 run_mlr --opprint put '$y = ssub($x, "LL",       "12345")'      $indir/sub.dat
 2154 run_mlr --opprint put '$y = ssub($x, "LLO",      "")'           $indir/sub.dat
 2155 run_mlr --opprint put '$y = ssub($x, "LLO",      "12")'         $indir/sub.dat
 2156 run_mlr --opprint put '$y = ssub($x, "LLO",      "123")'        $indir/sub.dat
 2157 run_mlr --opprint put '$y = ssub($x, "LLO",      "123456")'     $indir/sub.dat
 2158 run_mlr --opprint put '$y = ssub($x, "HELLO",    "")'           $indir/sub.dat
 2159 run_mlr --opprint put '$y = ssub($x, "HELLO",    "1234")'       $indir/sub.dat
 2160 run_mlr --opprint put '$y = ssub($x, "HELLO",    "12345")'      $indir/sub.dat
 2161 run_mlr --opprint put '$y = ssub($x, "HELLO",    "1234678")'    $indir/sub.dat
 2162 run_mlr --opprint put '$y = ssub($x, "nonesuch", "")'           $indir/sub.dat
 2163 run_mlr --opprint put '$y = ssub($x, "nonesuch", "1234")'       $indir/sub.dat
 2164 run_mlr --opprint put '$y = ssub($x, "nonesuch", "1234567890")' $indir/sub.dat
 2165 
 2166 run_mlr --oxtab put '$y = regextract($x, "[A-Z]+")' $indir/sub.dat
 2167 run_mlr --oxtab put '$y = regextract($x, "[A-Z]*")' $indir/sub.dat
 2168 run_mlr --oxtab put '$y = regextract($x, "[a-z]+")' $indir/sub.dat
 2169 run_mlr --oxtab put '$y = regextract($x, "[a-z]*")' $indir/sub.dat
 2170 run_mlr --oxtab put '$y = regextract($x, "[0-9]+")' $indir/sub.dat
 2171 run_mlr --oxtab put '$y = regextract($x, "[0-9]*")' $indir/sub.dat
 2172 
 2173 run_mlr --oxtab put '$y = regextract($x, "[ef]+")' $indir/sub.dat
 2174 run_mlr --oxtab put '$y = regextract($x, "[ef]*")' $indir/sub.dat
 2175 run_mlr --oxtab put '$y = regextract($x, "[hi]+")' $indir/sub.dat
 2176 run_mlr --oxtab put '$y = regextract($x, "[hi]*")' $indir/sub.dat
 2177 run_mlr --oxtab put '$y = regextract($x, "[op]+")' $indir/sub.dat
 2178 run_mlr --oxtab put '$y = regextract($x, "[op]*")' $indir/sub.dat
 2179 
 2180 run_mlr --oxtab put '$y = regextract_or_else($x, "[A-Z]+", "DEFAULT")' $indir/sub.dat
 2181 run_mlr --oxtab put '$y = regextract_or_else($x, "[A-Z]*", "DEFAULT")' $indir/sub.dat
 2182 run_mlr --oxtab put '$y = regextract_or_else($x, "[a-z]+", "DEFAULT")' $indir/sub.dat
 2183 run_mlr --oxtab put '$y = regextract_or_else($x, "[a-z]*", "DEFAULT")' $indir/sub.dat
 2184 run_mlr --oxtab put '$y = regextract_or_else($x, "[0-9]+", "DEFAULT")' $indir/sub.dat
 2185 run_mlr --oxtab put '$y = regextract_or_else($x, "[0-9]*", "DEFAULT")' $indir/sub.dat
 2186 
 2187 run_mlr --oxtab put '$y = regextract_or_else($x, "[ef]+", "DEFAULT")' $indir/sub.dat
 2188 run_mlr --oxtab put '$y = regextract_or_else($x, "[ef]*", "DEFAULT")' $indir/sub.dat
 2189 run_mlr --oxtab put '$y = regextract_or_else($x, "[hi]+", "DEFAULT")' $indir/sub.dat
 2190 run_mlr --oxtab put '$y = regextract_or_else($x, "[hi]*", "DEFAULT")' $indir/sub.dat
 2191 run_mlr --oxtab put '$y = regextract_or_else($x, "[op]+", "DEFAULT")' $indir/sub.dat
 2192 run_mlr --oxtab put '$y = regextract_or_else($x, "[op]*", "DEFAULT")' $indir/sub.dat
 2193 
 2194 echo 'abcdefg' | run_mlr --nidx put '$1 = sub($1, "ab(.)d(..)g",  "ab<<\1>>d<<\2>>g")'
 2195 echo 'abcdefg' | run_mlr --nidx put '$1 = sub($1, "ab(c)?d(..)g", "ab<<\1>>d<<\2>>g")'
 2196 echo 'abXdefg' | run_mlr --nidx put '$1 = sub($1, "ab(c)?d(..)g", "ab<<\1>>d<<\2>>g")'
 2197 echo 'abdefg'  | run_mlr --nidx put '$1 = sub($1, "ab(c)?d(..)g", "ab<<\1>>d<<\2>>g")'
 2198 
 2199 # ----------------------------------------------------------------
 2200 announce DSL SUBSTR
 2201 
 2202 run_mlr put -q '
 2203   int n = strlen($x);
 2204   print "input= <<".$x.">>";
 2205   for (i = -n-2; i <= n+2; i += 1) {
 2206     for (j = -n-2; j <= n+2; j += 1) {
 2207       print "i: ".fmtnum(i,"%3lld")
 2208         ."   j:".fmtnum(j,"%3lld")
 2209         ."   substr(".$x.",".fmtnum(i,"%3lld").",".fmtnum(j,"%3lld")."): <<"
 2210         .substr($x, i, j) .">>";
 2211     }
 2212     print;
 2213 }
 2214 ' << EOF
 2215 x=
 2216 x=o
 2217 x=o1
 2218 x=o123456789
 2219 EOF
 2220 
 2221 # ----------------------------------------------------------------
 2222 announce DSL SYSTEM
 2223 
 2224 run_mlr put '$counter = system("echo X".NR."Y")' $indir/abixy
 2225 
 2226 # ----------------------------------------------------------------
 2227 announce DSL OOSVARS
 2228 
 2229 run_mlr --opprint put -v 'begin{@ox=0}; $d=$x-@ox; @ox=$x' $indir/abixy
 2230 run_mlr --opprint put -v 'begin{@ox="no"}; $d=@ox == "no" ? 1.0 : $x/@ox; @ox=$x' then step -a ratio -f x $indir/abixy
 2231 run_mlr --opprint put -v '$d=$x/@ox; @ox=$x' then step -a ratio -f x $indir/abixy
 2232 run_mlr --opprint put -v 'begin{@ox="no"}; $d=@ox == "no" ? 1.0 : $x/@ox; @ox=$x' then step -a ratio -f x $indir/abixy
 2233 run_mlr --opprint put -v 'begin{@rsum = 0}; @rsum = @rsum + $x; $rsum = @rsum' $indir/abixy
 2234 run_mlr --opprint put -v 'begin{@a=0; @b=0; @c=0}; $za=@a; $zb=@b; $zc=@c; $d=@a+@b+@c; @a=@b; @b=@c; @c=$i' $indir/abixy
 2235 run_mlr --opprint put -v 'begin {@a=0; @b=0; @c=0}; $za=@a; $zb=@b; $zc=@c; $d=@a+@b+@c; @a=@b; @b=@c; @c=$i' $indir/abixy
 2236 run_mlr --opprint put -v 'begin{@ox=0}; $d=$x-@ox; @ox=$x' $indir/abixy
 2237 
 2238 run_mlr put -v '@a=$a; @b=$b; @c=$x; end {emitf @a; emitf @b; emitf @c}' $indir/abixy
 2239 run_mlr put -v '@a=$a; @b=$b; @c=$x; end{emitf @a, @b, @c}' $indir/abixy
 2240 
 2241 run_mlr --opprint put -v 'begin {@count=0; @sum=0.0}; @count=@count+1; @sum=@sum+$x; end{@mean=@sum/@count; emitf @mean}' $indir/abixy
 2242 run_mlr --opprint put -v 'end{@mean=@sum/@count; emitf @mean}; begin {@count=0; @sum=0.0}; @count=@count+1; @sum=@sum+$x' $indir/abixy
 2243 
 2244 run_mlr put -v 'begin{ @a = @b[1] }; $c = @d; @e[$i][2+$j][3] = $4; end{@f[@g[5][@h]] = 6}' /dev/null
 2245 
 2246 run_mlr put '@y[$a]=$y; end{dump}' $indir/abixy
 2247 
 2248 run_mlr stats1 -a sum -f y -g a $indir/abixy
 2249 run_mlr put '@y_sum[$a] = $y; end{dump}' $indir/abixy
 2250 
 2251 
 2252 run_mlr put -q '@s=$x; @t[$a]=$x; @u[$a][$b]=$x; end{dump; unset @s      ; dump}' $indir/unset1.dkvp
 2253 
 2254 run_mlr put -q '@s=$x; @t[$a]=$x; @u[$a][$b]=$x; end{dump; unset @t      ; dump}' $indir/unset1.dkvp
 2255 run_mlr put -q '@s=$x; @t[$a]=$x; @u[$a][$b]=$x; end{dump; unset @t[1]   ; dump}' $indir/unset1.dkvp
 2256 
 2257 run_mlr put -q '@s=$x; @t[$a]=$x; @u[$a][$b]=$x; end{dump; unset @u      ; dump}' $indir/unset1.dkvp
 2258 run_mlr put -q '@s=$x; @t[$a]=$x; @u[$a][$b]=$x; end{dump; unset @u[1]   ; dump}' $indir/unset1.dkvp
 2259 run_mlr put -q '@s=$x; @t[$a]=$x; @u[$a][$b]=$x; end{dump; unset @u[1][2]; dump}' $indir/unset1.dkvp
 2260 
 2261 
 2262 run_mlr put -q '@s=$x; @t[$a]=$x; @u[$a][$b]=$x; end{dump; unset @s      ; dump}' $indir/unset4.dkvp
 2263 
 2264 run_mlr put -q '@s=$x; @t[$a]=$x; @u[$a][$b]=$x; end{dump; unset @t      ; dump}' $indir/unset4.dkvp
 2265 run_mlr put -q '@s=$x; @t[$a]=$x; @u[$a][$b]=$x; end{dump; unset @t[1]   ; dump}' $indir/unset4.dkvp
 2266 
 2267 run_mlr put -q '@s=$x; @t[$a]=$x; @u[$a][$b]=$x; end{dump; unset @u      ; dump}' $indir/unset4.dkvp
 2268 run_mlr put -q '@s=$x; @t[$a]=$x; @u[$a][$b]=$x; end{dump; unset @u[1]   ; dump}' $indir/unset4.dkvp
 2269 run_mlr put -q '@s=$x; @t[$a]=$x; @u[$a][$b]=$x; end{dump; unset @u[1][2]; dump}' $indir/unset4.dkvp
 2270 
 2271 run_mlr put -q '@s=$x; @t[$a]=$x; @u[$a][$b]=$x; end{dump; unset all;      dump}' $indir/unset4.dkvp
 2272 run_mlr put -q '@s=$x; @t[$a]=$x; @u[$a][$b]=$x; end{dump; unset @*;       dump}' $indir/unset4.dkvp
 2273 
 2274 run_mlr put 'unset $x' $indir/unset4.dkvp
 2275 run_mlr put 'unset $*; $aaa = 999' $indir/unset4.dkvp
 2276 run_mlr --from $indir/abixy put 'x = 1; print "OX=".x; unset x; print "NX=".x'
 2277 
 2278 run_mlr put -q '@{variable.name} += $x; end{emit @{variable.name}}' $indir/abixy
 2279 run_mlr put -q '@{variable.name}[$a] += $x; end{emit @{variable.name},"a"}' $indir/abixy
 2280 
 2281 run_mlr put 'for (k,v in $*) { if (k == "i") {unset $[k]}}' $indir/abixy
 2282 
 2283 run_mlr --opprint --from $indir/abixy put -q '
 2284   @output[NR] = $*;
 2285   end {
 2286     for ((nr, k), v in @output) {
 2287       if (nr == 4 || k == "i") {
 2288         unset @output[nr][k]
 2289       }
 2290     }
 2291     emitp @output, "NR", "k"
 2292   }
 2293 '
 2294 
 2295 # ----------------------------------------------------------------
 2296 announce DSL PATTERN-ACTION BLOCKS
 2297 
 2298 run_mlr put -v 'begin{@a=1}; $e=2; $f==$g||$h==$i {};               $x=6; end{@z=9}' /dev/null
 2299 run_mlr put -v 'begin{@a=1}; $e=2; $f==$g||$h==$i {$s=1};           $x=6; end{@z=9}' /dev/null
 2300 run_mlr put -v 'begin{@a=1}; $e=2; $f==$g||$h==$i {$s=1;$t=2};      $x=6; end{@z=9}' /dev/null
 2301 run_mlr put -v 'begin{@a=1}; $e=2; $f==$g||$h==$i {$s=1;$t=2;$u=3}; $x=6; end{@z=9}' /dev/null
 2302 run_mlr put -v 'begin{@a=1}; $e=2; $f==$g||$h==$i {$s=1;@t["u".$5]=2;emitf @v,@w;dump}; $x=6; end{@z=9}' /dev/null
 2303 run_mlr put -v 'begin{true{@x=1}}; true{@x=2}; end{true{@x=3}}' /dev/null
 2304 
 2305 # ----------------------------------------------------------------
 2306 announce DSL STACK-ALLOCATION
 2307 
 2308 # This important test validates the local-stack allocator: which variables are
 2309 # assigned which offsets in the stack, and how the local-extent contract is
 2310 # satisfied by the clear-at-enter-subframe logic. The -v flag gives context on
 2311 # the AST; the -a flag provides the essential output on variable placement; the
 2312 # Miller script per se validates semantics.
 2313 
 2314 run_mlr --from $indir/abixy put -v -a -f $indir/test-dsl-stack-allocation.mlr
 2315 
 2316 # These test absent-null handing for as-yet-undefined localvars in expression RHSs.
 2317 run_mlr --from $indir/abixy put 'a=a; $oa = a'
 2318 run_mlr --from $indir/abixy put 'a=a; $oa = a; a = a; $ob = a'
 2319 run_mlr --from $indir/abixy put 'a=a; $oa = a; a = a; $ob = a; a = b; $oc = a'
 2320 run_mlr --from $indir/abixy put 'a=a; $oa = a; a = a; $ob = a; a = b; $oc = a; b = 3; b = a; $od = a'
 2321 run_mlr --from $indir/abixy put 'a=a; $oa = a; a = a; $ob = a; a = b; $oc = a; b = 3; b = a; $od = a; b = 4;a = b; $oe= a'
 2322 
 2323 # ----------------------------------------------------------------
 2324 announce DSL IF-CHAINING
 2325 
 2326 mention IF/ELIF WITH ELSE
 2327 run_mlr --from $indir/xy40.dkvp put -v '
 2328   if (NR==1) {
 2329     $x = 2;
 2330     $y = 3
 2331   }'
 2332 
 2333 run_mlr --from $indir/xy40.dkvp put -v '
 2334   if (NR == 4) {
 2335     $x = 5;
 2336     $y = 6
 2337   } else {
 2338     $x = 1007;
 2339     $y = 1008
 2340   }'
 2341 
 2342 run_mlr --from $indir/xy40.dkvp put -v '
 2343   if (NR == 9) {
 2344     $x = 10;
 2345     $y = 11
 2346   } elif (NR == 12) {
 2347     $x = 13;
 2348     $y = 14
 2349   } else {
 2350     $x = 1015;
 2351     $y = 1016
 2352   }'
 2353 
 2354 run_mlr --from $indir/xy40.dkvp put -v '
 2355   if (NR == 17) {
 2356     $x = 18;
 2357     $y = 19
 2358   } elif (NR == 20) {
 2359     $x = 21;
 2360     $y = 22
 2361   } elif (NR == 23) {
 2362     $x = 24;
 2363     $y = 25
 2364   } else {
 2365     $x = 1026;
 2366     $y = 1027
 2367   }'
 2368 
 2369 run_mlr --from $indir/xy40.dkvp put -v '
 2370   if (NR == 28) {
 2371     $x = 29;
 2372     $y = 30
 2373   } elif (NR == 31) {
 2374     $x = 32;
 2375     $y = 33
 2376   } elif (NR == 34) {
 2377     $x = 35;
 2378     $y = 36
 2379   } elif (NR == 37) {
 2380     $x = 38;
 2381     $y = 39
 2382   } else {
 2383     $x = 1040;
 2384     $y = 1041
 2385   }'
 2386 
 2387 mention IF/ELIF WITHOUT ELSE
 2388 run_mlr --from $indir/xy40.dkvp put -v '
 2389   if (NR == 1) {
 2390     $x = 2;
 2391     $y = 3
 2392   }'
 2393 
 2394 run_mlr --from $indir/xy40.dkvp put -v '
 2395   if (NR == 4) {
 2396     $x = 5;
 2397     $y = 6
 2398   } elif (NR == 7) {
 2399     $x = 8;
 2400     $y = 9
 2401   }'
 2402 
 2403 run_mlr --from $indir/xy40.dkvp put -v '
 2404   if (NR == 10) {
 2405     $x = 11;
 2406     $y = 12
 2407   } elif (NR == 13) {
 2408     $x = 14;
 2409     $y = 15
 2410   } elif (NR == 16) {
 2411     $x = 17;
 2412     $y = 18
 2413   }'
 2414 
 2415 run_mlr --from $indir/xy40.dkvp put -v '
 2416   if (NR == 19) {
 2417     $x = 20;
 2418     $y = 21
 2419   } elif (NR == 22) {
 2420     $x = 23;
 2421     $y = 24
 2422   } elif (NR == 25) {
 2423     $x = 26;
 2424     $y = 37
 2425   } elif (NR == 28) {
 2426     $x = 29;
 2427     $y = 30
 2428   }'
 2429 
 2430 # ----------------------------------------------------------------
 2431 announce DSL INDIRECT SREC ASSIGNMENTS
 2432 
 2433 run_mlr put -v '$["a"] = $["b"]; $["x"] = 10 * $["y"]' $indir/abixy
 2434 run_mlr --from $indir/abixy put 'while (NF < 256) { $["k".string(NF+1)] = "v".string(NF) }'
 2435 
 2436 # ----------------------------------------------------------------
 2437 announce DSL INDIRECT OOSVAR ASSIGNMENTS
 2438 
 2439 run_mlr --opprint put -v '@s = NR; $t = @s; $u=@["s"]; $v = $t - $u' $indir/abixy
 2440 
 2441 run_mlr put -v '@t["u"] = NR; $tu = @["t"]["u"]; emitp all' $indir/abixy
 2442 run_mlr put -v '@t["u"] = NR; $tu = @["t"]["u"]; emitp @*' $indir/abixy
 2443 
 2444 run_mlr put -v '@["s"] = $x; emitp all' $indir/abixy
 2445 
 2446 run_mlr put -v '@["t"]["u"] = $y; emitp all' $indir/abixy
 2447 
 2448 # xxx @* on the right
 2449 # xxx @* on the left
 2450 
 2451 # ----------------------------------------------------------------
 2452 announce DSL WHILE/DO-WHILE LOOPS
 2453 
 2454 run_mlr put -v 'while($i < 5) { $i += 1}' $indir/abixy
 2455 run_mlr put -v 'do {$i += 1} while($i < 5)' $indir/abixy
 2456 
 2457 # ----------------------------------------------------------------
 2458 announce DSL FOR-SREC LOOPS
 2459 
 2460 mention empty for-srec
 2461 run_mlr --from $indir/abixy put -v 'for(k,v in $*) { }'
 2462 
 2463 mention for-srec without boundvars
 2464 run_mlr --from $indir/abixy put -v 'for(k,v in $*) {$nr= NR}'
 2465 
 2466 mention for-srec modifying the srec
 2467 run_mlr --from $indir/abixy put -v 'for(k,v in $*) {unset $[k]}; $j = NR'
 2468 run_mlr --from $indir/abixy put -v 'for(k,v in $*) {if (k != "x") {unset $[k]}}; $j = NR'
 2469 run_mlr --from $indir/abixy --opprint put -S -v 'for(k,v in $*) {$[k."_orig"]=v; $[k] = "other"}'
 2470 run_mlr --from $indir/abixy put -S -v 'for(k,v in $*) {$[v]=k}'
 2471 
 2472 run_mlr --from $indir/abixy put -v '
 2473   $sum = 0;
 2474   for(k,v in $*) {
 2475     if (k =~ "^[xy]$") {
 2476       $sum += $[k]
 2477     }
 2478   }'
 2479 
 2480 run_mlr --from $indir/abixy put -S -v '
 2481   $sum = float(0);
 2482   for(k,v in $*) {
 2483     if (k =~ "^[xy]$") {
 2484       $sum += float($[k])
 2485     }
 2486   }'
 2487 
 2488 # ----------------------------------------------------------------
 2489 announce DSL FOR-OOSVAR LOOPS
 2490 
 2491 run_mlr --opprint -n put -v '
 2492   @o[1][1]["text1"][NR] = $a;
 2493   @o[1][2]["text2"][NR] = $b;
 2494   @o[1][2][$a][$i*100] = $x;
 2495   for((k1,k2),v in @o[1][2]) {
 2496     @n[3][4][k2][k1] = v;
 2497   }
 2498   end {
 2499     emit @n, "a", "b", "c", "d"
 2500   }
 2501 '
 2502 
 2503 run_mlr --opprint --from $indir/abixy put -q '
 2504   @o[1][1]["text1"][NR] = $a;
 2505   @o[1][2]["text2"][NR] = $b;
 2506   @o[1][2][$a][$i*100] = $x;
 2507   for((k1,k2),v in @o[1][2]) {
 2508     @n[3][4][k2][k1] = v;
 2509   }
 2510   end {
 2511     emit @n, "a", "b", "c", "d"
 2512   }
 2513 '
 2514 
 2515 run_mlr --opprint --from $indir/abixy put -q '
 2516   @sum[$a][$b] += $x;
 2517   @count[$a][$b] += 1;
 2518   end {
 2519     for ((k1, k2), v in @sum) {
 2520       @mean[k1][k2] = @sum[k1][k2] / @count[k1][k2]
 2521     }
 2522     emitp @sum, "a", "b";
 2523     emitp @count, "a", "b";
 2524     emitp @mean, "a", "b"
 2525   }
 2526 '
 2527 
 2528 run_mlr --opprint --from $indir/abixy-wide put -q '
 2529   @value["sum"][$a][$b] += $x;
 2530   @value["count"][$a][$b] += 1;
 2531   end {
 2532     for ((k1, k2), v in @value["sum"]) {
 2533       @value["mean"][k1][k2] = @value["sum"][k1][k2] / @value["count"][k1][k2]
 2534     }
 2535     emitp @value, "stat", "a", "b";
 2536   }
 2537 '
 2538 
 2539 mlr_expect_fail -n put -v 'for (k, k in $*) {}'
 2540 
 2541 mlr_expect_fail -n put -v 'for (k, k in @*) {}'
 2542 
 2543 mlr_expect_fail -n put -v 'for ((a,a), c in @*) {}'
 2544 mlr_expect_fail -n put -v 'for ((a,b), a in @*) {}'
 2545 mlr_expect_fail -n put -v 'for ((a,b), b in @*) {}'
 2546 
 2547 mlr_expect_fail -n put -v 'for ((a,a,c), d in @*) {}'
 2548 mlr_expect_fail -n put -v 'for ((a,b,a), d in @*) {}'
 2549 mlr_expect_fail -n put -v 'for ((a,b,c), a in @*) {}'
 2550 mlr_expect_fail -n put -v 'for ((a,b,b), d in @*) {}'
 2551 mlr_expect_fail -n put -v 'for ((a,b,c), b in @*) {}'
 2552 mlr_expect_fail -n put -v 'for ((a,b,c), c in @*) {}'
 2553 
 2554 run_mlr --from $indir/xyz2 put -q 'func f() { return {"a"."b":"c"."d",3:4}}; for (k,v in f()){print "k=".k.",v=".v}'
 2555 run_mlr --from $indir/xyz2 put -q 'for (k,v in {"a"."b":"c"."d",3:"c"}) {print "k=".k.",v=".v}'
 2556 run_mlr --from $indir/xyz2 put -q 'o["a"."b"]="c"."d"; for (k,v in o) {print "k=".k.",v=".v}'
 2557 run_mlr --from $indir/xyz2 put -q '@o["a"."b"]="c"."d"; for (k,v in @o) {print "k=".k.",v=".v}'
 2558 run_mlr --from $indir/xyz2 put 'for (k in $*) { print k}'
 2559 run_mlr --from $indir/xyz2 put 'm=$*; for (k in m) { print k}'
 2560 
 2561 # ----------------------------------------------------------------
 2562 announce DSL FOR-BIND LOOPS FOR VALGRIND
 2563 
 2564 mention key-only fors
 2565 
 2566 run_mlr --from $indir/abixy-het put '
 2567   ab = $a . "_" . $b;
 2568   xy = $x . "_" . $y;
 2569   map o = {};
 2570   o[ab] = xy;
 2571   for (k in o) {
 2572     print "k is " . k;
 2573   }
 2574 '
 2575 
 2576 run_mlr --from $indir/abixy-het put '
 2577   ab = $a . "_" . $b;
 2578   xy = $x . "_" . $y;
 2579   unset @o;
 2580   @o[ab] = xy;
 2581   for (k in @o) {
 2582     print "k is " . k;
 2583   }
 2584 '
 2585 
 2586 run_mlr --from $indir/abixy-het put '
 2587   ab = $a . "_" . $b;
 2588   xy = $x . "_" . $y;
 2589   for (k in {ab : xy}) {
 2590     print "k is " . k;
 2591   }
 2592 '
 2593 
 2594 run_mlr --from $indir/abixy-het put '
 2595   func f(a, b, x, y): map {
 2596     ab = $a . "_" . $b;
 2597     xy = $x . "_" . $y;
 2598     return {ab : xy};
 2599   }
 2600   for (k in f($a, $b, $x, $y)) {
 2601     print "k is " . k;
 2602   }
 2603 '
 2604 
 2605 mention key-value fors with scalar values
 2606 
 2607 run_mlr --from $indir/abixy-het put '
 2608   ab = $a . "_" . $b;
 2609   xy = $x . "_" . $y;
 2610   map o = {};
 2611   o[ab] = xy;
 2612   for (k, v in o) {
 2613     print "k is " . k . "  v is " . v;
 2614   }
 2615 '
 2616 
 2617 run_mlr --from $indir/abixy-het put '
 2618   ab = $a . "_" . $b;
 2619   xy = $x . "_" . $y;
 2620   unset @o;
 2621   @o[ab] = xy;
 2622   for (k, v in @o) {
 2623     print "k is " . k . "  v is " . v;
 2624   }
 2625 '
 2626 
 2627 run_mlr --from $indir/abixy-het put '
 2628   ab = $a . "_" . $b;
 2629   xy = $x . "_" . $y;
 2630   for (k, v in {ab : xy}) {
 2631     print "k is " . k . "  v is " . v;
 2632   }
 2633 '
 2634 
 2635 run_mlr --from $indir/abixy-het put '
 2636   func f(a, b, x, y): map {
 2637     ab = $a . "_" . $b;
 2638     xy = $x . "_" . $y;
 2639     return {ab : xy};
 2640   }
 2641   for (k, v in f($a, $b, $x, $y)) {
 2642     print "k is " . k . "  v is " . v;
 2643   }
 2644 '
 2645 
 2646 
 2647 mention key-value fors with map values
 2648 
 2649 run_mlr --from $indir/abixy-het put '
 2650   ab = $a . "_" . $b;
 2651   xy = $x . "_" . $y;
 2652   map o = {};
 2653   o[ab] = {"foo": xy};
 2654   for (k, v in o) {
 2655     print "k is " . k . "  v is ";
 2656     dump v;
 2657   }
 2658 '
 2659 
 2660 run_mlr --from $indir/abixy-het put '
 2661   ab = $a . "_" . $b;
 2662   xy = $x . "_" . $y;
 2663   unset @o;
 2664   @o[ab]["foo"] = xy;
 2665   for (k, v in @o) {
 2666     print "k is " . k . "  v is ";
 2667     dump v;
 2668   }
 2669 '
 2670 
 2671 run_mlr --from $indir/abixy-het put '
 2672   ab = $a . "_" . $b;
 2673   xy = $x . "_" . $y;
 2674   for (k, v in {ab : {"foo": xy}}) {
 2675     print "k is " . k . "  v is ";
 2676     dump v;
 2677   }
 2678 '
 2679 
 2680 run_mlr --from $indir/abixy-het put '
 2681   func f(a, b, x, y): map {
 2682     ab = $a . "_" . $b;
 2683     xy = $x . "_" . $y;
 2684     return {ab : {"foo" : xy}};
 2685   }
 2686   for (k, v in f($a, $b, $x, $y)) {
 2687     print "k is " . k . "  v is ";
 2688     dump v;
 2689   }
 2690 '
 2691 
 2692 # ----------------------------------------------------------------
 2693 announce DSL BREAK/CONTINUE IN SINGLE WHILE/DO-WHILE
 2694 
 2695 run_mlr --opprint --from $indir/abixy put '
 2696   while ($i < 5) {
 2697     $i += 1;
 2698     break;
 2699     $a = "ERROR";
 2700   }
 2701 '
 2702 
 2703 run_mlr --opprint --from $indir/abixy put '
 2704   while ($i < 5) {
 2705     $i += 1;
 2706     continue;
 2707     $a = "ERROR";
 2708   }
 2709 '
 2710 
 2711 run_mlr --opprint --from $indir/abixy put '
 2712   do {
 2713     $i += 1;
 2714     break;
 2715     $a = "ERROR";
 2716   } while ($i < 5);
 2717 '
 2718 
 2719 run_mlr --opprint --from $indir/abixy put '
 2720   do {
 2721     $i += 1;
 2722     continue;
 2723     $a = "ERROR";
 2724   } while ($i < 5);
 2725 '
 2726 
 2727 run_mlr --opprint --from $indir/abixy put '
 2728   $NR = NR;
 2729   while ($i < 5) {
 2730     $i += 1;
 2731     if (NR == 2) {
 2732       break;
 2733     }
 2734     $a = "reached";
 2735   }
 2736 '
 2737 
 2738 run_mlr --opprint --from $indir/abixy put '
 2739   $NR = NR;
 2740   while ($i < 5) {
 2741     $i += 1;
 2742     if (NR == 2) {
 2743       continue;
 2744     }
 2745     $a = "reached";
 2746   }
 2747 '
 2748 
 2749 run_mlr --opprint --from $indir/abixy put '
 2750 $NR = NR;
 2751   do {
 2752     $i += 1;
 2753     if (NR == 2) {
 2754       break;
 2755     }
 2756     $a = "reached";
 2757   } while ($i < 5);
 2758 '
 2759 
 2760 run_mlr --opprint --from $indir/abixy put '
 2761   $NR = NR;
 2762   do {
 2763     $i += 1;
 2764     if (NR == 2) {
 2765       continue;
 2766     }
 2767     $a = "reached";
 2768   } while ($i < 5);
 2769 '
 2770 
 2771 # ----------------------------------------------------------------
 2772 announce DSL BREAK/CONTINUE IN NESTED WHILE/DO-WHILE
 2773 
 2774 run_mlr --opprint --from $indir/abixy put '
 2775   $j = NR;
 2776   while ($j < 4) {
 2777     $k = NR;
 2778     $j += 1;
 2779     break;
 2780     while ($k < 7) {
 2781       $k += 1
 2782     }
 2783   }
 2784 '
 2785 
 2786 run_mlr --opprint --from $indir/abixy put '
 2787   $j = NR;
 2788   while ($j < 4) {
 2789     $k = NR;
 2790     $j += 1;
 2791     continue;
 2792     while ($k < 7) {
 2793       $k += 1
 2794     }
 2795   }
 2796 '
 2797 
 2798 run_mlr --opprint --from $indir/abixy put '
 2799   $j = NR;
 2800   while ($j < 4) {
 2801     $k = NR;
 2802     $j += 1;
 2803     while ($k < 7) {
 2804       $k += 1;
 2805       break;
 2806       $k += 10000;
 2807     }
 2808   }
 2809 '
 2810 
 2811 run_mlr --opprint --from $indir/abixy put '
 2812   $j = NR;
 2813   while ($j < 4) {
 2814     $k = NR;
 2815     $j += 1;
 2816     while ($k < 7) {
 2817       $k += 1;
 2818       continue;
 2819       $k += 10000;
 2820     }
 2821   }
 2822 '
 2823 
 2824 
 2825 run_mlr --opprint --from $indir/abixy put '
 2826   $j = NR;
 2827   while ($j < 4) {
 2828     $k = NR;
 2829     $j += 1;
 2830     if (NR == 2 || NR == 8) {
 2831       break;
 2832     }
 2833     while ($k < 7) {
 2834       $k += 1
 2835     }
 2836   }
 2837 '
 2838 
 2839 run_mlr --opprint --from $indir/abixy put '
 2840   $j = NR;
 2841   while ($j < 4) {
 2842     $k = NR;
 2843     $j += 1;
 2844     if (NR == 2 || NR == 8) {
 2845       continue;
 2846     }
 2847     while ($k < 7) {
 2848       $k += 1
 2849     }
 2850   }
 2851 '
 2852 
 2853 run_mlr --opprint --from $indir/abixy put '
 2854   $j = NR;
 2855   while ($j < 4) {
 2856     $k = NR;
 2857     $j += 1;
 2858     while ($k < 7) {
 2859       $k += 1;
 2860       if (NR == 2 || NR == 8) {
 2861         break;
 2862       }
 2863       $k += 10000;
 2864     }
 2865   }
 2866 '
 2867 
 2868 run_mlr --opprint --from $indir/abixy put '
 2869   $j = NR;
 2870   while ($j < 4) {
 2871     $k = NR;
 2872     $j += 1;
 2873     while ($k < 7) {
 2874       $k += 1;
 2875       if (NR == 2 || NR == 8) {
 2876         continue;
 2877       }
 2878       $k += 10000;
 2879     }
 2880   }
 2881 '
 2882 
 2883 
 2884 run_mlr --opprint --from $indir/abixy put '
 2885   $j = NR;
 2886   do {
 2887     $k = NR;
 2888     $j += 1;
 2889     break;
 2890     do {
 2891       $k += 1
 2892     } while ($k < 7);
 2893   } while ($j < 4);
 2894 '
 2895 
 2896 run_mlr --opprint --from $indir/abixy put '
 2897   $j = NR;
 2898   do {
 2899     $k = NR;
 2900     $j += 1;
 2901     continue;
 2902     do {
 2903       $k += 1
 2904     } while ($k < 7);
 2905   } while ($j < 4);
 2906 '
 2907 
 2908 run_mlr --opprint --from $indir/abixy put '
 2909   $j = NR;
 2910   do {
 2911     $k = NR;
 2912     $j += 1;
 2913     do {
 2914       $k += 1;
 2915       break;
 2916       $k += 10000;
 2917     } while ($k < 7);
 2918   } while ($j < 4);
 2919 '
 2920 
 2921 run_mlr --opprint --from $indir/abixy put '
 2922   $j = NR;
 2923   do {
 2924     $k = NR;
 2925     $j += 1;
 2926     do {
 2927       $k += 1;
 2928       continue;
 2929       $k += 10000;
 2930     } while ($k < 7);
 2931   } while ($j < 4);
 2932 '
 2933 
 2934 
 2935 run_mlr --opprint --from $indir/abixy put '
 2936   $j = NR;
 2937   do {
 2938     $k = NR;
 2939     $j += 1;
 2940     if (NR == 2 || NR == 8) {
 2941       break;
 2942     }
 2943     do {
 2944       $k += 1
 2945     } while ($k < 7);
 2946   } while ($j < 4);
 2947 '
 2948 
 2949 run_mlr --opprint --from $indir/abixy put '
 2950   $j = NR;
 2951   do {
 2952     $k = NR;
 2953     $j += 1;
 2954     if (NR == 2 || NR == 8) {
 2955       continue;
 2956     }
 2957     do {
 2958       $k += 1
 2959     } while ($k < 7);
 2960   } while ($j < 4);
 2961 '
 2962 
 2963 run_mlr --opprint --from $indir/abixy put '
 2964   $j = NR;
 2965   do {
 2966     $k = NR;
 2967     $j += 1;
 2968     do {
 2969       $k += 1;
 2970       if (NR == 2 || NR == 8) {
 2971         break;
 2972       }
 2973       $k += 10000;
 2974     } while ($k < 7);
 2975   } while ($j < 4);
 2976 '
 2977 
 2978 run_mlr --opprint --from $indir/abixy put '
 2979   $j = NR;
 2980   do {
 2981     $k = NR;
 2982     $j += 1;
 2983     do {
 2984       $k += 1;
 2985       if (NR == 2 || NR == 8) {
 2986         continue;
 2987       }
 2988       $k += 10000;
 2989     } while ($k < 7);
 2990   } while ($j < 4);
 2991 '
 2992 
 2993 
 2994 # ----------------------------------------------------------------
 2995 announce DSL BREAK/CONTINUE IN SINGLE FOR-SREC
 2996 
 2997 run_mlr --opprint --from $indir/abixy put -q '
 2998   for (k,v in $*) {
 2999       @logging1[NR][k] = v;
 3000       if (k == "x") {
 3001           break;
 3002       }
 3003   }
 3004   end {
 3005     emitp @logging1, "NR", "k";
 3006   }
 3007 '
 3008 
 3009 run_mlr --opprint --from $indir/abixy put -q '
 3010   for (k,v in $*) {
 3011       if (k == "x") {
 3012           break;
 3013       }
 3014       @logging2[NR][k] = v;
 3015   }
 3016   end {
 3017     emitp @logging2, "NR", "k";
 3018   }
 3019 '
 3020 
 3021 run_mlr --opprint --from $indir/abixy put -q '
 3022   for (k,v in $*) {
 3023       @logging3[NR][k] = v;
 3024       if (k == "x") {
 3025           continue;
 3026       }
 3027   }
 3028   end {
 3029     emitp @logging3, "NR", "k";
 3030   }
 3031 '
 3032 
 3033 run_mlr --opprint --from $indir/abixy put -q '
 3034   for (k,v in $*) {
 3035       if (k == "x") {
 3036           continue;
 3037       }
 3038       @logging4[NR][k] = v;
 3039   }
 3040   end {
 3041     emitp @logging4, "NR", "k"
 3042   }
 3043 '
 3044 
 3045 run_mlr --opprint --from $indir/abixy put -q '
 3046   for (k,v in $*) {
 3047       @logging1[NR][k] = v;
 3048       if (k == "x") {
 3049           break;
 3050       }
 3051   }
 3052 
 3053   for (k,v in $*) {
 3054       if (k == "x") {
 3055           break;
 3056       }
 3057       @logging2[NR][k] = v;
 3058   }
 3059 
 3060   for (k,v in $*) {
 3061       @logging3[NR][k] = v;
 3062       if (k == "x") {
 3063           continue;
 3064       }
 3065   }
 3066 
 3067   for (k,v in $*) {
 3068       if (k == "x") {
 3069           continue;
 3070       }
 3071       @logging4[NR][k] = v;
 3072   }
 3073 
 3074   end {
 3075     emitp @logging1, "NR", "k";
 3076     emitp @logging2, "NR", "k";
 3077     emitp @logging3, "NR", "k";
 3078     emitp @logging4, "NR", "k"
 3079   }
 3080 '
 3081 
 3082 # ----------------------------------------------------------------
 3083 announce DSL BREAK/CONTINUE IN NESTED FOR-SREC
 3084 
 3085 run_mlr --opprint --from $indir/abixy put -q '
 3086   for (k1, v1 in $*) {
 3087     @output1[NR][k1] = "before";
 3088     break;
 3089     @output1[NR][k1] = v1;
 3090     for (k2, v2 in $*) {
 3091       @output2[NR][k1."_".k2] = "before";
 3092       @output2[NR][k1."_".k2] = v2;
 3093     }
 3094   }
 3095   end {
 3096     emit @output1, "NR", "name";
 3097     emit @output2, "NR", "names";
 3098   }
 3099 '
 3100 
 3101 run_mlr --opprint --from $indir/abixy put -q '
 3102   for (k1, v1 in $*) {
 3103     @output1[NR][k1] = "before";
 3104     continue;
 3105     @output1[NR][k1] = v1;
 3106     for (k2, v2 in $*) {
 3107       @output2[NR][k1."_".k2] = "before";
 3108       @output2[NR][k1."_".k2] = v2;
 3109     }
 3110   }
 3111   end {
 3112     emit @output1, "NR", "name";
 3113     emit @output2, "NR", "names";
 3114   }
 3115 '
 3116 
 3117 run_mlr --opprint --from $indir/abixy put -q '
 3118   for (k1, v1 in $*) {
 3119     @output1[NR][k1] = "before";
 3120     @output1[NR][k1] = v1;
 3121     for (k2, v2 in $*) {
 3122       @output2[NR][k1."_".k2] = "before";
 3123       break;
 3124       @output2[NR][k1."_".k2] = v2;
 3125     }
 3126   }
 3127   end {
 3128     emit @output1, "NR", "name";
 3129     emit @output2, "NR", "names";
 3130   }
 3131 '
 3132 
 3133 run_mlr --opprint --from $indir/abixy put -q '
 3134   for (k1, v1 in $*) {
 3135     @output1[NR][k1] = "before";
 3136     @output1[NR][k1] = v1;
 3137     for (k2, v2 in $*) {
 3138       @output2[NR][k1."_".k2] = "before";
 3139       continue;
 3140       @output2[NR][k1."_".k2] = v2;
 3141     }
 3142   }
 3143   end {
 3144     emit @output1, "NR", "name";
 3145     emit @output2, "NR", "names";
 3146   }
 3147 '
 3148 
 3149 run_mlr --opprint --from $indir/abixy put -q '
 3150   for (k1, v1 in $*) {
 3151     @output1[NR][k1] = "before";
 3152     break;
 3153     @output1[NR][k1] = v1;
 3154     for (k2, v2 in $*) {
 3155       @output2[NR][k1."_".k2] = "before";
 3156       break;
 3157       @output2[NR][k1."_".k2] = v2;
 3158     }
 3159   }
 3160   end {
 3161     emit @output1, "NR", "name";
 3162     emit @output2, "NR", "names";
 3163   }
 3164 '
 3165 
 3166 run_mlr --opprint --from $indir/abixy put -q '
 3167   for (k1, v1 in $*) {
 3168     @output1[NR][k1] = "before";
 3169     continue;
 3170     @output1[NR][k1] = v1;
 3171     for (k2, v2 in $*) {
 3172       @output2[NR][k1."_".k2] = "before";
 3173       break;
 3174       @output2[NR][k1."_".k2] = v2;
 3175     }
 3176   }
 3177   end {
 3178     emit @output1, "NR", "name";
 3179     emit @output2, "NR", "names";
 3180   }
 3181 '
 3182 
 3183 
 3184 run_mlr --opprint --from $indir/abixy put -q '
 3185   for (k1, v1 in $*) {
 3186     @output1[NR][k1] = "before";
 3187     break;
 3188     @output1[NR][k1] = v1;
 3189     for (k2, v2 in $*) {
 3190       @output2[NR][k1."_".k2] = "before";
 3191       continue;
 3192       @output2[NR][k1."_".k2] = v2;
 3193     }
 3194   }
 3195   end {
 3196     emit @output1, "NR", "name";
 3197     emit @output2, "NR", "names";
 3198   }
 3199 '
 3200 
 3201 run_mlr --opprint --from $indir/abixy put -q '
 3202   for (k1, v1 in $*) {
 3203     @output1[NR][k1] = "before";
 3204     continue;
 3205     @output1[NR][k1] = v1;
 3206     for (k2, v2 in $*) {
 3207       @output2[NR][k1."_".k2] = "before";
 3208       continue;
 3209       @output2[NR][k1."_".k2] = v2;
 3210     }
 3211   }
 3212   end {
 3213     emit @output1, "NR", "name";
 3214     emit @output2, "NR", "names";
 3215   }
 3216 '
 3217 
 3218 
 3219 run_mlr --opprint --from $indir/abixy put -q '
 3220   for (k1, v1 in $*) {
 3221     @output1[NR][k1] = "before";
 3222     if (k1 == "b") {
 3223         break
 3224     }
 3225     @output1[NR][k1] = v1;
 3226     for (k2, v2 in $*) {
 3227       @output2[NR][k1."_".k2] = "before";
 3228       @output2[NR][k1."_".k2] = v2;
 3229     }
 3230   }
 3231   end {
 3232     emit @output1, "NR", "name";
 3233     emit @output2, "NR", "names";
 3234   }
 3235 '
 3236 
 3237 run_mlr --opprint --from $indir/abixy put -q '
 3238   for (k1, v1 in $*) {
 3239     @output1[NR][k1] = "before";
 3240     if (k1 == "b") {
 3241         continue
 3242     }
 3243     @output1[NR][k1] = v1;
 3244     for (k2, v2 in $*) {
 3245       @output2[NR][k1."_".k2] = "before";
 3246       @output2[NR][k1."_".k2] = v2;
 3247     }
 3248   }
 3249   end {
 3250     emit @output1, "NR", "name";
 3251     emit @output2, "NR", "names";
 3252   }
 3253 '
 3254 
 3255 run_mlr --opprint --from $indir/abixy put -q '
 3256   for (k1, v1 in $*) {
 3257     @output1[NR][k1] = "before";
 3258     @output1[NR][k1] = v1;
 3259     for (k2, v2 in $*) {
 3260       @output2[NR][k1."_".k2] = "before";
 3261       if (k2 == "a") {
 3262           break
 3263       }
 3264       @output2[NR][k1."_".k2] = v2;
 3265     }
 3266   }
 3267   end {
 3268     emit @output1, "NR", "name";
 3269     emit @output2, "NR", "names";
 3270   }
 3271 '
 3272 
 3273 run_mlr --opprint --from $indir/abixy put -q '
 3274   for (k1, v1 in $*) {
 3275     @output1[NR][k1] = "before";
 3276     @output1[NR][k1] = v1;
 3277     for (k2, v2 in $*) {
 3278       @output2[NR][k1."_".k2] = "before";
 3279       if (k2 == "b") {
 3280           continue
 3281       }
 3282       @output2[NR][k1."_".k2] = v2;
 3283     }
 3284   }
 3285   end {
 3286     emit @output1, "NR", "name";
 3287     emit @output2, "NR", "names";
 3288   }
 3289 '
 3290 
 3291 
 3292 run_mlr --opprint --from $indir/abixy put -q '
 3293   for (k1, v1 in $*) {
 3294     @output1[NR][k1] = "before";
 3295     if (k1 == "b") {
 3296         break
 3297     }
 3298     @output1[NR][k1] = v1;
 3299     for (k2, v2 in $*) {
 3300       @output2[NR][k1."_".k2] = "before";
 3301       if (k2 == "a") {
 3302           break
 3303       }
 3304       @output2[NR][k1."_".k2] = v2;
 3305     }
 3306   }
 3307   end {
 3308     emit @output1, "NR", "name";
 3309     emit @output2, "NR", "names";
 3310   }
 3311 '
 3312 
 3313 run_mlr --opprint --from $indir/abixy put -q '
 3314   for (k1, v1 in $*) {
 3315     @output1[NR][k1] = "before";
 3316     if (k1 == "b") {
 3317         continue
 3318     }
 3319     @output1[NR][k1] = v1;
 3320     for (k2, v2 in $*) {
 3321       @output2[NR][k1."_".k2] = "before";
 3322       if (k2 == "a") {
 3323           break
 3324       }
 3325       @output2[NR][k1."_".k2] = v2;
 3326     }
 3327   }
 3328   end {
 3329     emit @output1, "NR", "name";
 3330     emit @output2, "NR", "names";
 3331   }
 3332 '
 3333 
 3334 
 3335 run_mlr --opprint --from $indir/abixy put -q '
 3336   for (k1, v1 in $*) {
 3337     @output1[NR][k1] = "before";
 3338     if (k1 == "b") {
 3339         break
 3340     }
 3341     @output1[NR][k1] = v1;
 3342     for (k2, v2 in $*) {
 3343       @output2[NR][k1."_".k2] = "before";
 3344       if (k2 == "a") {
 3345           continue
 3346       }
 3347       @output2[NR][k1."_".k2] = v2;
 3348     }
 3349   }
 3350   end {
 3351     emit @output1, "NR", "name";
 3352     emit @output2, "NR", "names";
 3353   }
 3354 '
 3355 
 3356 run_mlr --opprint --from $indir/abixy put -q '
 3357   for (k1, v1 in $*) {
 3358     @output1[NR][k1] = "before";
 3359     if (k1 == "b") {
 3360         continue
 3361     }
 3362     @output1[NR][k1] = v1;
 3363     for (k2, v2 in $*) {
 3364       @output2[NR][k1."_".k2] = "before";
 3365       if (k2 == "a") {
 3366           continue
 3367       }
 3368       @output2[NR][k1."_".k2] = v2;
 3369     }
 3370   }
 3371   end {
 3372     emit @output1, "NR", "name";
 3373     emit @output2, "NR", "names";
 3374   }
 3375 '
 3376 
 3377 
 3378 # ----------------------------------------------------------------
 3379 announce FOR-MAP DEPTH TESTS
 3380 
 3381 mention 'for full oosvar'
 3382 run_mlr --from $indir/abixy put '@o[1][2] = 7; for(k1,v in @*) {$x+=10;$y+=100}'
 3383 run_mlr --from $indir/abixy put '@o[1][2] = 7; for((k1),v in @*) {$x+=10;$y+=100}'
 3384 run_mlr --from $indir/abixy put '@o[1][2] = 7; for((k1,k2),v in @*) {$x+=10;$y+=100}'
 3385 run_mlr --from $indir/abixy put '@o[1][2] = 7; for((k1,k2,k3),v in @*) {$x+=10;$y+=100}'
 3386 
 3387 mention 'for oosvar submap'
 3388 run_mlr --from $indir/abixy put '@o[1][2][3] = 7; for(k1,v in @o[1][2]) {$x+=10;$y+=100}'
 3389 run_mlr --from $indir/abixy put '@o[1][2][3] = 7; for((k1),v in @o[1][2]) {$x+=10;$y+=100}'
 3390 run_mlr --from $indir/abixy put '@o[1][2][3] = 7; for((k1,k2),v in @o[1][2]) {$x+=10;$y+=100}'
 3391 run_mlr --from $indir/abixy put '@o[1][2][3] = 7; for((k1,k2,k3),v in @o[1][2]) {$x+=10;$y+=100}'
 3392 
 3393 mention 'for local'
 3394 run_mlr --from $indir/abixy put 'o[1][2] = 7; for(k1,v in o) {$x+=10;$y+=100}'
 3395 run_mlr --from $indir/abixy put 'o[1][2] = 7; for((k1),v in o) {$x+=10;$y+=100}'
 3396 run_mlr --from $indir/abixy put 'o[1][2] = 7; for((k1,k2),v in o) {$x+=10;$y+=100}'
 3397 run_mlr --from $indir/abixy put 'o[1][2] = 7; for((k1,k2,k3),v in o) {$x+=10;$y+=100}'
 3398 
 3399 mention 'for map-literal'
 3400 run_mlr --from $indir/abixy put 'for(k1,v in {1:{2:7}}) {$x+=10;$y+=100}'
 3401 run_mlr --from $indir/abixy put 'for((k1),v in {1:{2:7}}) {$x+=10;$y+=100}'
 3402 run_mlr --from $indir/abixy put 'for((k1,k2),v in {1:{2:7}}) {$x+=10;$y+=100}'
 3403 run_mlr --from $indir/abixy put 'for((k1,k2,k3),v in {1:{2:7}}) {$x+=10;$y+=100}'
 3404 
 3405 # ----------------------------------------------------------------
 3406 announce DSL BREAK/CONTINUE IN SINGLE FOR-OOSVAR
 3407 
 3408 mention single-key tests, direct break/continue
 3409 
 3410 run_mlr --opprint --from $indir/abixy put -q '
 3411   @logging[NR] = $*;
 3412   end {
 3413     for (k1, v in @logging[2]) {
 3414         break;
 3415         @output[k1] = v;
 3416     }
 3417     emit @output, "NR", "name"
 3418   }
 3419 '
 3420 
 3421 run_mlr --opprint --from $indir/abixy put -q '
 3422   @logging[NR] = $*;
 3423   end {
 3424     for (k1, v in @logging[2]) {
 3425         @output[k1] = v;
 3426         break;
 3427         @output[k1] = "ERROR";
 3428     }
 3429     emit @output, "NR", "name"
 3430   }
 3431 '
 3432 
 3433 run_mlr --opprint --from $indir/abixy put -q '
 3434   @logging[NR] = $*;
 3435   end {
 3436     for (k1, v in @logging[2]) {
 3437         continue;
 3438         @output[k1] = v
 3439     }
 3440     emit @output, "NR", "name"
 3441   }
 3442 '
 3443 
 3444 run_mlr --opprint --from $indir/abixy put -q '
 3445   @logging[NR] = $*;
 3446   end {
 3447     for (k1, v in @logging[2]) {
 3448         @output[k1] = v;
 3449         continue;
 3450         @output[k1] = "ERROR";
 3451     }
 3452     emit @output, "NR", "name"
 3453   }
 3454 '
 3455 
 3456 mention single-key tests, indirect break/continue
 3457 
 3458 run_mlr --opprint --from $indir/abixy put -q '
 3459   @logging[NR] = $*;
 3460   end {
 3461     for (k1, v in @logging[2]) {
 3462         if (k1 == "i") {
 3463           break;
 3464         }
 3465         @output[k1] = v;
 3466     }
 3467     emit @output, "NR", "name"
 3468   }
 3469 '
 3470 
 3471 run_mlr --opprint --from $indir/abixy put -q '
 3472   @logging[NR] = $*;
 3473   end {
 3474     for (k1, v in @logging[2]) {
 3475         @output[k1] = v;
 3476         if (k1 == "i") {
 3477           break;
 3478         }
 3479     }
 3480     emit @output, "NR", "name"
 3481   }
 3482 '
 3483 
 3484 run_mlr --opprint --from $indir/abixy put -q '
 3485   @logging[NR] = $*;
 3486   end {
 3487     for (k1, v in @logging[2]) {
 3488         if (k1 == "i") {
 3489           continue;
 3490         }
 3491         @output[k1] = v
 3492     }
 3493     emit @output, "NR", "name"
 3494   }
 3495 '
 3496 
 3497 run_mlr --opprint --from $indir/abixy put -q '
 3498   @logging[NR] = $*;
 3499   end {
 3500     for (k1, v in @logging[2]) {
 3501         @output[k1] = v;
 3502         if (k1 == "i") {
 3503           continue;
 3504         }
 3505         @output[k1] = "reached";
 3506     }
 3507     emit @output, "NR", "name"
 3508   }
 3509 '
 3510 
 3511 mention multiple-key tests, direct break/continue
 3512 
 3513 run_mlr --opprint --from $indir/abixy put -q '
 3514   @logging[NR] = $*;
 3515   end {
 3516     for ((k1, k2), v in @logging) {
 3517         break;
 3518         @output[k1][k2] = v;
 3519     }
 3520     emit @output, "NR", "name"
 3521   }
 3522 '
 3523 
 3524 run_mlr --opprint --from $indir/abixy put -q '
 3525   @logging[NR] = $*;
 3526   end {
 3527     for ((k1, k2), v in @logging) {
 3528         @output[k1][k2] = v;
 3529         break;
 3530         @output[k1][k2] = "ERROR"
 3531     }
 3532     emit @output, "NR", "name"
 3533   }
 3534 '
 3535 
 3536 run_mlr --opprint --from $indir/abixy put -q '
 3537   @logging[NR] = $*;
 3538   end {
 3539     for ((k1, k2), v in @logging) {
 3540         continue;
 3541         @output[k1][k2] = v
 3542     }
 3543     emit @output, "NR", "name"
 3544   }
 3545 '
 3546 
 3547 run_mlr --opprint --from $indir/abixy put -q '
 3548   @logging[NR] = $*;
 3549   end {
 3550     for ((k1, k2), v in @logging) {
 3551         @output[k1][k2] = v;
 3552         continue;
 3553         @output[k1][k2] = "ERROR";
 3554     }
 3555     emit @output, "NR", "name"
 3556   }
 3557 '
 3558 
 3559 mention multiple-key tests, indirect break/continue
 3560 
 3561 run_mlr --opprint --from $indir/abixy put -q '
 3562   @logging[NR] = $*;
 3563   end {
 3564     for ((k1, k2), v in @logging) {
 3565         if (k1 == 5) {
 3566           break;
 3567         }
 3568         @output[k1][k2] = v;
 3569     }
 3570     emit @output, "NR", "name"
 3571   }
 3572 '
 3573 run_mlr --opprint --from $indir/abixy put -q '
 3574   @logging[NR] = $*;
 3575   end {
 3576     for ((k1, k2), v in @logging) {
 3577         if (k2 == "i") {
 3578           break;
 3579         }
 3580         @output[k1][k2] = v;
 3581     }
 3582     emit @output, "NR", "name"
 3583   }
 3584 '
 3585 
 3586 run_mlr --opprint --from $indir/abixy put -q '
 3587   @logging[NR] = $*;
 3588   end {
 3589     for ((k1, k2), v in @logging) {
 3590         @output[k1][k2] = v;
 3591         if (k1 == 5) {
 3592           break;
 3593         }
 3594     }
 3595     emit @output, "NR", "name"
 3596   }
 3597 '
 3598 run_mlr --opprint --from $indir/abixy put -q '
 3599   @logging[NR] = $*;
 3600   end {
 3601     for ((k1, k2), v in @logging) {
 3602         @output[k1][k2] = v;
 3603         if (k2 == "i") {
 3604           break;
 3605         }
 3606     }
 3607     emit @output, "NR", "name"
 3608   }
 3609 '
 3610 
 3611 run_mlr --opprint --from $indir/abixy put -q '
 3612   @logging[NR] = $*;
 3613   end {
 3614     for ((k1, k2), v in @logging) {
 3615         if (k1 == 5) {
 3616           continue;
 3617         }
 3618         @output[k1][k2] = v
 3619     }
 3620     emit @output, "NR", "name"
 3621   }
 3622 '
 3623 run_mlr --opprint --from $indir/abixy put -q '
 3624   @logging[NR] = $*;
 3625   end {
 3626     for ((k1, k2), v in @logging) {
 3627         if (k2 == "i") {
 3628           continue;
 3629         }
 3630         @output[k1][k2] = v
 3631     }
 3632     emit @output, "NR", "name"
 3633   }
 3634 '
 3635 
 3636 run_mlr --opprint --from $indir/abixy put -q '
 3637   @logging[NR] = $*;
 3638   end {
 3639     for ((k1, k2), v in @logging) {
 3640         @output[k1][k2] = "before";
 3641         if (k1 == 5) {
 3642           continue;
 3643         }
 3644         @output[k1][k2] = v;
 3645     }
 3646     emit @output, "NR", "name"
 3647   }
 3648 '
 3649 run_mlr --opprint --from $indir/abixy put -q '
 3650   @logging[NR] = $*;
 3651   end {
 3652     for ((k1, k2), v in @logging) {
 3653         @output[k1][k2] = "before";
 3654         if (k2 == "i") {
 3655           continue;
 3656         }
 3657         @output[k1][k2] = v;
 3658     }
 3659     emit @output, "NR", "name"
 3660   }
 3661 '
 3662 
 3663 
 3664 # ----------------------------------------------------------------
 3665 announce DSL BREAK/CONTINUE IN NESTED FOR-OOSVAR
 3666 
 3667 run_mlr --opprint --from $indir/abixy put -q '
 3668   @logging[NR] = $*;
 3669   end {
 3670     for ((k1, k2), v in @logging) {
 3671         if (k1 != 2) {
 3672           continue
 3673         }
 3674         for ((k3, k4), v in @logging) {
 3675           if (k3 != 4) {
 3676             continue
 3677           }
 3678           @output[k1][k2][k3][k4] = v;
 3679         }
 3680     }
 3681     emit @output, "NR1", "name1", "NR2", "name2"
 3682   }
 3683 '
 3684 
 3685 # ----------------------------------------------------------------
 3686 announce DSL PRINT
 3687 
 3688 run_mlr put -q 'print  1; print  "two"; print  $a; print;  print  $i < 4; print  "y is ".string($y); print ""' $indir/abixy
 3689 run_mlr put -q 'printn 1; printn "two"; printn $a; printn; printn $i < 4; printn "y is ".string($y); print ""' $indir/abixy
 3690 
 3691 run_mlr put -q 'print  $*; print  $*; print  {}; print' $indir/abixy
 3692 run_mlr put -q 'printn $*; printn $*; printn {}; print' $indir/abixy
 3693 
 3694 # ----------------------------------------------------------------
 3695 announce ABSENT/EMPTY
 3696 
 3697 run_mlr put -q '@sum     += $x; end{emitp @sum}'      $indir/abixy
 3698 run_mlr put -q '@sum[$a] += $x; end{emitp @sum, "a"}' $indir/abixy
 3699 run_mlr put    '$nonesuch = @nonesuch' $indir/abixy
 3700 
 3701 run_mlr put -q '@sum     += $x; end{emitp @sum}'      $indir/abixy-het
 3702 run_mlr put -q '@sum[$a] += $x; end{emitp @sum, "a"}' $indir/abixy-het
 3703 run_mlr put    '$nonesuch = @nonesuch' $indir/abixy-het
 3704 
 3705 run_mlr put -q '@sum += $x; @sumtype = typeof(@sum); @xtype = typeof($x); emitf @sumtype, @xtype, @sum; end{emitp @sum}' $indir/abixy
 3706 run_mlr put -q '@sum += $x; @sumtype = typeof(@sum); @xtype = typeof($x); emitf @sumtype, @xtype, @sum; end{emitp @sum}' $indir/abixy-het
 3707 
 3708 run_mlr put '$z = $x + $y' $indir/typeof.dkvp
 3709 run_mlr put '$z = $x + $u' $indir/typeof.dkvp
 3710 
 3711 run_mlr put '@s = @s + $y; emitp @s' $indir/typeof.dkvp
 3712 run_mlr put '@s = @s + $u; emitp @s' $indir/typeof.dkvp
 3713 
 3714 run_mlr put '$z = $x + $y; $x=typeof($x);$y=typeof($y);$z=typeof($z)' $indir/typeof.dkvp
 3715 run_mlr put '$z = $x + $u; $x=typeof($x);$y=typeof($y);$z=typeof($z)' $indir/typeof.dkvp
 3716 
 3717 run_mlr put '@s = @s + $y; $x=typeof($x);$y=typeof($y);$z=typeof($z);$s=typeof(@s)' $indir/typeof.dkvp
 3718 run_mlr put '@s = @s + $u; $x=typeof($x);$y=typeof($y);$z=typeof($z);$s=typeof(@s)' $indir/typeof.dkvp
 3719 
 3720 run_mlr cat << EOF
 3721 x=1
 3722 x=
 3723 x=7
 3724 EOF
 3725 
 3726 run_mlr --ofs tab put '$osum=@sum; $ostype=typeof(@sum);$xtype=typeof($x);@sum+=$x; $nstype=typeof(@sum);$nsum=@sum; end { emit @sum }' <<EOF
 3727 x=1
 3728 x=
 3729 x=7
 3730 EOF
 3731 
 3732 run_mlr --ofs tab put '$osum=@sum; $ostype=typeof(@sum);$xtype=typeof($x);is_present($x){@sum+=$x}; $nstype=typeof(@sum);$nsum=@sum; end { emit @sum }' <<EOF
 3733 x=1
 3734 x=
 3735 x=7
 3736 EOF
 3737 
 3738 run_mlr cat << EOF
 3739 x=1
 3740 xxx=
 3741 x=7
 3742 EOF
 3743 
 3744 run_mlr --ofs tab put '$osum=@sum; $ostype=typeof(@sum);$xtype=typeof($x);@sum+=$x; $nstype=typeof(@sum);$nsum=@sum; end { emit @sum }' <<EOF
 3745 x=1
 3746 xxx=
 3747 x=7
 3748 EOF
 3749 
 3750 run_mlr --ofs tab put '$osum=@sum; $ostype=typeof(@sum);$xtype=typeof($x);is_present($x){@sum+=$x}; $nstype=typeof(@sum);$nsum=@sum; end { emit @sum }' <<EOF
 3751 x=1
 3752 xxx=
 3753 x=7
 3754 EOF
 3755 
 3756 run_mlr cat << EOF
 3757 x=1
 3758 x=
 3759 y=
 3760 x=7
 3761 EOF
 3762 
 3763 run_mlr --ofs tab put '$xtype=typeof($x);$sum = $x + 10; $stype=typeof($sum)' <<EOF
 3764 x=1
 3765 x=
 3766 y=
 3767 x=7
 3768 EOF
 3769 
 3770 run_mlr --ofs tab put '$xtype=typeof($x);$sum = is_present($x) ? $x + 10 : 999; $stype=typeof($sum)' <<EOF
 3771 x=1
 3772 x=
 3773 y=
 3774 x=7
 3775 EOF
 3776 
 3777 
 3778 # ----------------------------------------------------------------
 3779 announce MAP-VARIANT DUMPS
 3780 
 3781 run_mlr --from $indir/abixy-het put -q 'dump {"a"."b":$a.$b}'
 3782 run_mlr --from $indir/abixy-het put -q 'func f(a, b) { return {"a"."b":a.b} } dump f($a, $b)'
 3783 
 3784 # ----------------------------------------------------------------
 3785 announce PARAMETERIZED EMIT
 3786 
 3787 run_mlr put -q '@sum[$a] = $x; end{ emitp @sum; }'         $indir/abixy
 3788 run_mlr put -q '@sum[$a] = $x; end{ emitp @sum,"a"; }'     $indir/abixy
 3789 run_mlr put -q '@sum[$a] = $x; end{ emitp @sum,"a","b"; }' $indir/abixy
 3790 
 3791 run_mlr put -q '@sum[$a][$b] = $x; end{ emitp @sum; }'         $indir/abixy
 3792 run_mlr put -q '@sum[$a][$b] = $x; end{ emitp @sum,"a"; }'     $indir/abixy
 3793 run_mlr put -q '@sum[$a][$b] = $x; end{ emitp @sum,"a","b"; }' $indir/abixy
 3794 
 3795 run_mlr put -q '@v = $a;        end {emitf @v }' $indir/abixy
 3796 run_mlr put -q '@v = $i;        end {emitf @v }' $indir/abixy
 3797 run_mlr put -q '@v = $x;        end {emitf @v }' $indir/abixy
 3798 run_mlr put -q '@v = $nonesuch; end {emitf @v }' $indir/abixy
 3799 
 3800 run_mlr put -q '@v = $a;        end {emitp @v }' $indir/abixy
 3801 run_mlr put -q '@v = $i;        end {emitp @v }' $indir/abixy
 3802 run_mlr put -q '@v = $x;        end {emitp @v }' $indir/abixy
 3803 run_mlr put -q '@v = $nonesuch; end {emitp @v }' $indir/abixy
 3804 
 3805 run_mlr put -q '@sum += $i;        end {emitf @sum }' $indir/abixy
 3806 run_mlr put -q '@sum += $x;        end {emitf @sum }' $indir/abixy
 3807 run_mlr put -q '@sum += $nonesuch; end {emitf @sum }' $indir/abixy
 3808 
 3809 run_mlr put -q '@sum += $i;        end {emitp  @sum          }' $indir/abixy
 3810 run_mlr put -q '@sum += $x;        end {emitp  @sum          }' $indir/abixy
 3811 run_mlr put -q '@sum += $nonesuch; end {emitp  @sum          }' $indir/abixy
 3812 run_mlr put -q '@sum += $i;        end {emitp  @sum, "extra" }' $indir/abixy
 3813 run_mlr put -q '@sum += $x;        end {emitp  @sum, "extra" }' $indir/abixy
 3814 run_mlr put -q '@sum += $nonesuch; end {emitp  @sum, "extra" }' $indir/abixy
 3815 
 3816 run_mlr put -q '@sum[$a] += $i;        end {emitp  @sum               }' $indir/abixy
 3817 run_mlr put -q '@sum[$a] += $x;        end {emitp  @sum               }' $indir/abixy
 3818 run_mlr put -q '@sum[$a] += $nonesuch; end {emitp  @sum               }' $indir/abixy
 3819 run_mlr put -q '@sum[$a] += $i;        end {emitp  @sum, "a"          }' $indir/abixy
 3820 run_mlr put -q '@sum[$a] += $x;        end {emitp  @sum, "a"          }' $indir/abixy
 3821 run_mlr put -q '@sum[$a] += $nonesuch; end {emitp  @sum, "a"          }' $indir/abixy
 3822 run_mlr put -q '@sum[$a] += $i;        end {emitp  @sum, "a", "extra" }' $indir/abixy
 3823 run_mlr put -q '@sum[$a] += $x;        end {emitp  @sum, "a", "extra" }' $indir/abixy
 3824 run_mlr put -q '@sum[$a] += $nonesuch; end {emitp  @sum, "a", "extra" }' $indir/abixy
 3825 
 3826 run_mlr put -q '@sum[$a][$b] += $i;        end {emitp  @sum                    }' $indir/abixy
 3827 run_mlr put -q '@sum[$a][$b] += $x;        end {emitp  @sum                    }' $indir/abixy
 3828 run_mlr put -q '@sum[$a][$b] += $nonesuch; end {emitp  @sum                    }' $indir/abixy
 3829 run_mlr put -q '@sum[$a][$b] += $i;        end {emitp  @sum, "a"               }' $indir/abixy
 3830 run_mlr put -q '@sum[$a][$b] += $x;        end {emitp  @sum, "a"               }' $indir/abixy
 3831 run_mlr put -q '@sum[$a][$b] += $nonesuch; end {emitp  @sum, "a"               }' $indir/abixy
 3832 run_mlr put -q '@sum[$a][$b] += $i;        end {emitp  @sum, "a", "b"          }' $indir/abixy
 3833 run_mlr put -q '@sum[$a][$b] += $x;        end {emitp  @sum, "a", "b"          }' $indir/abixy
 3834 run_mlr put -q '@sum[$a][$b] += $nonesuch; end {emitp  @sum, "a", "b"          }' $indir/abixy
 3835 run_mlr put -q '@sum[$a][$b] += $i;        end {emitp  @sum, "a", "b", "extra" }' $indir/abixy
 3836 run_mlr put -q '@sum[$a][$b] += $x;        end {emitp  @sum, "a", "b", "extra" }' $indir/abixy
 3837 run_mlr put -q '@sum[$a][$b] += $nonesuch; end {emitp  @sum, "a", "b", "extra" }' $indir/abixy
 3838 
 3839 run_mlr --oxtab put -q '@sum[$a][$b] += $i; NR == 3 { @x = $x }; NR == 7 { @v = $* }; end {emitp all}' $indir/abixy-het
 3840 
 3841 run_mlr --opprint put -q '@v[NR]=$*; end{emitp @v}'     $indir/abixy
 3842 run_mlr --opprint put -q '@v[NR]=$*; end{emitp @v,"X"}' $indir/abixy
 3843 
 3844 run_mlr --opprint put -q '@v[NR]=$*; end{emitp @v[1]}'         $indir/abixy
 3845 run_mlr --opprint put -q '@v[NR]=$*; end{emitp @v[1],"X"}'     $indir/abixy
 3846 run_mlr --opprint put -q '@v[NR]=$*; end{emitp @v[1],"X","Y"}' $indir/abixy
 3847 
 3848 run_mlr --opprint put -q '@v[NR][NR]=$*; end{emitp @v[1]}'         $indir/abixy
 3849 run_mlr --opprint put -q '@v[NR][NR]=$*; end{emitp @v[1],"X"}'     $indir/abixy
 3850 run_mlr --opprint put -q '@v[NR][NR]=$*; end{emitp @v[1],"X","Y"}' $indir/abixy
 3851 
 3852 run_mlr --opprint put -q '@v[NR][NR]=$*; end{emitp @v[1][1]}'         $indir/abixy
 3853 run_mlr --opprint put -q '@v[NR][NR]=$*; end{emitp @v[1][1],"X"}'     $indir/abixy
 3854 run_mlr --opprint put -q '@v[NR][NR]=$*; end{emitp @v[1][1],"X","Y"}' $indir/abixy
 3855 
 3856 run_mlr put -q '@a=$a; @b[1]=$b; @c[1][2]=$x; end{emitp all}'                     $indir/abixy-het
 3857 run_mlr put -q '@a=$a; @b[1]=$b; @c[1][2]=$x; end{emitp all,"one"}'               $indir/abixy-het
 3858 run_mlr put -q '@a=$a; @b[1]=$b; @c[1][2]=$x; end{emitp all,"one","two"}'         $indir/abixy-het
 3859 run_mlr put -q '@a=$a; @b[1]=$b; @c[1][2]=$x; end{emitp all,"one","two","three"}' $indir/abixy-het
 3860 
 3861 run_mlr --oxtab put --oflatsep @ -q '@a=$a; @b[1]=$b; @c[1][2]=$x; end{emitp all}' $indir/abixy-het
 3862 
 3863 # ----------------------------------------------------------------
 3864 announce PREFIXED/UNPREFIXED EMIT
 3865 
 3866 run_mlr --oxtab put -q '@sum     += $x; end{dump;emitp  @sum     }'  $indir/abixy-wide
 3867 run_mlr --oxtab put -q '@sum     += $x; end{dump;emit @sum     }'  $indir/abixy-wide
 3868 
 3869 
 3870 run_mlr --oxtab put -q '@sum[$a] += $x; end{dump;emitp  @sum     }'  $indir/abixy-wide
 3871 run_mlr --oxtab put -q '@sum[$a] += $x; end{dump;emit @sum     }'  $indir/abixy-wide
 3872 
 3873 run_mlr --oxtab put -q '@sum[$a] += $x; end{dump;emitp  @sum, "a"}'  $indir/abixy-wide
 3874 run_mlr --oxtab put -q '@sum[$a] += $x; end{dump;emit @sum, "a"}'  $indir/abixy-wide
 3875 
 3876 
 3877 run_mlr --oxtab put -q '@sum[$a][$b] += $x; end{dump;emitp  @sum     }'  $indir/abixy-wide
 3878 run_mlr --oxtab put -q '@sum[$a][$b] += $x; end{dump;emit @sum     }'  $indir/abixy-wide
 3879 
 3880 run_mlr --oxtab put -q '@sum[$a][$b] += $x; end{dump;emitp  @sum, "a"}'  $indir/abixy-wide
 3881 run_mlr --oxtab put -q '@sum[$a][$b] += $x; end{dump;emit @sum, "a"}'  $indir/abixy-wide
 3882 
 3883 run_mlr --opprint put -q '@sum[$a][$b] += $x; end{dump;emitp  @sum, "a", "b"}'  $indir/abixy-wide
 3884 run_mlr --opprint put -q '@sum[$a][$b] += $x; end{dump;emit @sum, "a", "b"}'  $indir/abixy-wide
 3885 
 3886 
 3887 run_mlr --oxtab put -q '@sum[$a][$b][$a.$b] += $x; end{dump;emitp  @sum     }'  $indir/abixy-wide
 3888 run_mlr --oxtab put -q '@sum[$a][$b][$a.$b] += $x; end{dump;emit @sum     }'  $indir/abixy-wide
 3889 
 3890 run_mlr --oxtab put -q '@sum[$a][$b][$a.$b] += $x; end{dump;emitp  @sum, "a"}'  $indir/abixy-wide
 3891 run_mlr --oxtab put -q '@sum[$a][$b][$a.$b] += $x; end{dump;emit @sum, "a"}'  $indir/abixy-wide
 3892 
 3893 run_mlr --opprint put -q '@sum[$a][$b][$a.$b] += $x; end{dump;emitp  @sum, "a", "b"}'  $indir/abixy-wide
 3894 run_mlr --opprint put -q '@sum[$a][$b][$a.$b] += $x; end{dump;emit @sum, "a", "b"}'  $indir/abixy-wide
 3895 
 3896 run_mlr --opprint put -q '@sum[$a][$b][$a.$b] += $x; end{dump;emitp  @sum, "a", "b", "ab"}'  $indir/abixy-wide
 3897 run_mlr --opprint put -q '@sum[$a][$b][$a.$b] += $x; end{dump;emit @sum, "a", "b", "ab"}'  $indir/abixy-wide
 3898 
 3899 
 3900 
 3901 run_mlr --oxtab head -n 2  then put -q '@v       =  $*; end{dump;emitp  @v}'         $indir/abixy
 3902 run_mlr --oxtab head -n 2  then put -q '@v       =  $*; end{dump;emit @v}'         $indir/abixy
 3903 
 3904 
 3905 run_mlr --oxtab head -n 2  then put -q '@v[NR]   =  $*; end{dump;emitp  @v        }' $indir/abixy
 3906 run_mlr --oxtab head -n 2  then put -q '@v[NR]   =  $*; end{dump;emit @v        }' $indir/abixy
 3907 
 3908 run_mlr --opprint head -n 2  then put -q '@v[NR]   =  $*; end{dump;emitp  @v,   "I"}' $indir/abixy
 3909 run_mlr --opprint head -n 2  then put -q '@v[NR]   =  $*; end{dump;emit @v,   "I"}' $indir/abixy
 3910 
 3911 
 3912 run_mlr --oxtab head -n 2  then put -q '@v[NR][NR]   =  $*; end{dump;emitp  @v        }' $indir/abixy
 3913 run_mlr --oxtab head -n 2  then put -q '@v[NR][NR]   =  $*; end{dump;emit @v        }' $indir/abixy
 3914 
 3915 run_mlr --opprint head -n 2  then put -q '@v[NR][NR]   =  $*; end{dump;emitp  @v,   "I"}' $indir/abixy
 3916 run_mlr --opprint head -n 2  then put -q '@v[NR][NR]   =  $*; end{dump;emit @v,   "I"}' $indir/abixy
 3917 
 3918 run_mlr --opprint head -n 2  then put -q '@v[NR][NR]   =  $*; end{dump;emitp  @v,   "I", "J"}' $indir/abixy
 3919 run_mlr --opprint head -n 2  then put -q '@v[NR][NR]   =  $*; end{dump;emit @v,   "I", "J"}' $indir/abixy
 3920 
 3921 
 3922 run_mlr --oxtab head -n 2  then put -q '@v[NR][NR][NR]   =  $*; end{dump;emitp  @v        }' $indir/abixy
 3923 run_mlr --oxtab head -n 2  then put -q '@v[NR][NR][NR]   =  $*; end{dump;emit @v        }' $indir/abixy
 3924 
 3925 run_mlr --opprint head -n 2  then put -q '@v[NR][NR][NR]   =  $*; end{dump;emitp  @v,   "I"}' $indir/abixy
 3926 run_mlr --opprint head -n 2  then put -q '@v[NR][NR][NR]   =  $*; end{dump;emit @v,   "I"}' $indir/abixy
 3927 
 3928 run_mlr --opprint head -n 2  then put -q '@v[NR][NR][NR]   =  $*; end{dump;emitp  @v,   "I", "J"}' $indir/abixy
 3929 run_mlr --opprint head -n 2  then put -q '@v[NR][NR][NR]   =  $*; end{dump;emit @v,   "I", "J"}' $indir/abixy
 3930 
 3931 run_mlr --opprint head -n 2  then put -q '@v[NR][NR][NR]   =  $*; end{dump;emitp  @v,   "I", "J", "K"}' $indir/abixy
 3932 run_mlr --opprint head -n 2  then put -q '@v[NR][NR][NR]   =  $*; end{dump;emit @v,   "I", "J", "K"}' $indir/abixy
 3933 
 3934 
 3935 # ----------------------------------------------------------------
 3936 announce LASHED EMITP SINGLES
 3937 
 3938 run_mlr -n put 'end {
 3939   @a = 111;
 3940   emitp @a
 3941 }'
 3942 run_mlr -n put 'end {
 3943   @a = 111;
 3944   emitp (@a)
 3945 }'
 3946 
 3947 run_mlr -n put 'end {
 3948   @a[111] = 222;
 3949   emitp @a, "s"
 3950 }'
 3951 run_mlr -n put 'end {
 3952   @a[111] = 222;
 3953   emitp (@a), "s"
 3954 }'
 3955 
 3956 run_mlr -n put 'end {
 3957   @a[111] = 222;
 3958   @a[333] = 444;
 3959   emitp @a, "s"
 3960 }'
 3961 run_mlr -n put 'end {
 3962   @a[111] = 222;
 3963   @a[333] = 444;
 3964   emitp (@a), "s"
 3965 }'
 3966 
 3967 run_mlr -n put 'end {
 3968   @a[111][222] = 333;
 3969   emitp @a, "s"
 3970 }'
 3971 run_mlr -n put 'end {
 3972   @a[111][222] = 333;
 3973   emitp (@a), "s"
 3974 }'
 3975 
 3976 run_mlr -n put 'end {
 3977   @a[111][222] = 333;
 3978   @a[444][555] = 666;
 3979   emitp @a, "s"
 3980 }'
 3981 run_mlr -n put 'end {
 3982   @a[111][222] = 333;
 3983   @a[444][555] = 666;
 3984   emitp (@a), "s"
 3985 }'
 3986 
 3987 run_mlr -n put 'end {
 3988   @a[111][222] = 333;
 3989   emitp @a, "s", "t"
 3990 }'
 3991 run_mlr -n put 'end {
 3992   @a[111][222] = 333;
 3993   emitp (@a), "s", "t"
 3994 }'
 3995 
 3996 run_mlr -n put 'end {
 3997   @a[111][222] = 333;
 3998   emitp @a[111], "t"
 3999 }'
 4000 run_mlr -n put 'end {
 4001   @a[111][222] = 333;
 4002   emitp (@a[111]), "t"
 4003 }'
 4004 
 4005 # ----------------------------------------------------------------
 4006 announce LASHED EMIT SINGLES
 4007 
 4008 run_mlr -n put 'end {
 4009   @a = 111;
 4010   emit @a
 4011 }'
 4012 run_mlr -n put 'end {
 4013   @a = 111;
 4014   emit (@a)
 4015 }'
 4016 
 4017 run_mlr -n put 'end {
 4018   @a[111] = 222;
 4019   emit @a, "s"
 4020 }'
 4021 run_mlr -n put 'end {
 4022   @a[111] = 222;
 4023   emit (@a), "s"
 4024 }'
 4025 
 4026 run_mlr -n put 'end {
 4027   @a[111] = 222;
 4028   @a[333] = 444;
 4029   emit @a, "s"
 4030 }'
 4031 run_mlr -n put 'end {
 4032   @a[111] = 222;
 4033   @a[333] = 444;
 4034   emit (@a), "s"
 4035 }'
 4036 
 4037 run_mlr -n put 'end {
 4038   @a[111][222] = 333;
 4039   emit @a, "s"
 4040 }'
 4041 run_mlr -n put 'end {
 4042   @a[111][222] = 333;
 4043   emit (@a), "s"
 4044 }'
 4045 
 4046 # ----------------------------------------------------------------
 4047 announce LASHED EMITP PAIRS
 4048 
 4049 run_mlr -n put 'end {
 4050   @a = 111;
 4051   @b = 222;
 4052   emitp (@a, @b)
 4053 }'
 4054 
 4055 run_mlr -n put 'end {
 4056   @a[1] = 111;
 4057   @b[1] = 222;
 4058   emitp (@a[1], @b[1])
 4059 }'
 4060 
 4061 run_mlr -n put 'end {
 4062   @a[1][2][3] = 4;
 4063   @b[1][2][3] = 8;
 4064   emitp (@a, @b), "s", "t", "u"
 4065 }'
 4066 
 4067 run_mlr -n put 'end {
 4068   @a[1][2][3] = 4;
 4069   @b[5][2][3] = 8;
 4070   emitp (@a[1], @b[5]), "t", "u"
 4071 }'
 4072 
 4073 run_mlr -n put 'end {
 4074   @a[1][2][3] = 4;
 4075   @b[5][6][3] = 8;
 4076   emitp (@a[1][2], @b[5][6]), "u"
 4077 }'
 4078 
 4079 # ----------------------------------------------------------------
 4080 announce LASHED EMIT PAIRS
 4081 
 4082 run_mlr -n put 'end {
 4083   @a = 111;
 4084   @b = 222;
 4085   emit (@a, @b)
 4086 }'
 4087 
 4088 run_mlr -n put 'end {
 4089   @a[1] = 111;
 4090   @b[1] = 222;
 4091   emit (@a[1], @b[1])
 4092 }'
 4093 
 4094 run_mlr -n put 'end {
 4095   @a[1][2][3] = 4;
 4096   @b[1][2][3] = 8;
 4097   emit (@a, @b), "s", "t", "u"
 4098 }'
 4099 
 4100 run_mlr -n put 'end {
 4101   @a[1][2][3] = 4;
 4102   @b[5][2][3] = 8;
 4103   emit (@a[1], @b[5]), "t", "u"
 4104 }'
 4105 
 4106 run_mlr -n put 'end {
 4107   @a[1][2][3] = 4;
 4108   @b[5][6][3] = 8;
 4109   emit (@a[1][2], @b[5][6]), "u"
 4110 }'
 4111 
 4112 # ----------------------------------------------------------------
 4113 announce LASHED EMIT WITH VARYING DEPTH
 4114 
 4115 run_mlr -n put 'end {
 4116   @a[1][1] = 1;
 4117   @a[1][2] = 2;
 4118   @a[2][1] = 3;
 4119   @a[2][2] = 4;
 4120   @b[1][1] = 5;
 4121   @b[1][2] = 6;
 4122   @b[2][1] = 7;
 4123   @b[2][2] = 8;
 4124   emit (@a[1], @b[2]), "t"
 4125 }'
 4126 
 4127 run_mlr -n put 'end {
 4128   @a[1][1] = 1;
 4129   @a[1][2] = 2;
 4130   @a[2][1] = 3;
 4131   @a[2][2] = 4;
 4132   @b[1][1] = 5;
 4133   @b[1][2] = 6;
 4134   @b[2][1] = 7;
 4135   @b[2][2] = 8;
 4136   emit (@a, @b), "s", "t"
 4137 }'
 4138 
 4139 run_mlr -n put 'end {
 4140   @a[1][1] = 1;
 4141   @a[1][2] = 2;
 4142   @a[2][1] = 3;
 4143   @a[2][2] = 4;
 4144   @a[3] = 10;
 4145   @a[4] = 11;
 4146   @a[5][6][7] = 12;
 4147   @b[1][1] = 5;
 4148   @b[1][2] = 6;
 4149   @b[2][1] = 7;
 4150   @b[2][2] = 8;
 4151   emit (@a, @b), "s", "t"
 4152 }'
 4153 
 4154 run_mlr -n put 'end {
 4155   @a[1][1] = 1;
 4156   @a[1][2] = 2;
 4157   @a[2][1] = 3;
 4158   @a[2][2] = 4;
 4159   @a[3] = 10;
 4160   @a[4] = 11;
 4161   @a[5][6][7] = 12;
 4162   @b[1][1] = 5;
 4163   @b[1][2] = 6;
 4164   @b[2][1] = 7;
 4165   @b[2][2] = 8;
 4166   emit (@b, @a), "s", "t"
 4167 }'
 4168 
 4169 
 4170 run_mlr -n put 'end {
 4171   @a[1][2][3] = 4;
 4172   @b[5][2][3] = 8;
 4173   emit (@a[1], @b[3]), "t", "u"
 4174 }'
 4175 
 4176 run_mlr -n put 'end {
 4177   @a[1][2][3] = 4;
 4178   @b[5][2][3] = 8;
 4179   emit (@a[1][2], @b[5][9]), "t", "u"
 4180 }'
 4181 
 4182 run_mlr -n put 'end {
 4183   @a[1][2][3] = 4;
 4184   @b[5][2][3] = 8;
 4185   emit (@a[1][2], @b[9][2]), "t", "u"
 4186 }'
 4187 
 4188 run_mlr -n put 'end {
 4189   @a[1][2][3] = 4;
 4190   @b[5][2][3] = 8;
 4191   emit (@a[9], @b[5]), "t", "u"
 4192 }'
 4193 
 4194 # ----------------------------------------------------------------
 4195 announce LASHED EMITP WITH VARYING DEPTH
 4196 
 4197 run_mlr -n put 'end {
 4198   @a[1][1] = 1;
 4199   @a[1][2] = 2;
 4200   @a[2][1] = 3;
 4201   @a[2][2] = 4;
 4202   @b[1][1] = 5;
 4203   @b[1][2] = 6;
 4204   @b[2][1] = 7;
 4205   @b[2][2] = 8;
 4206   emitp (@a[1], @b[2]), "t"
 4207 }'
 4208 
 4209 run_mlr -n put 'end {
 4210   @a[1][1] = 1;
 4211   @a[1][2] = 2;
 4212   @a[2][1] = 3;
 4213   @a[2][2] = 4;
 4214   @b[1][1] = 5;
 4215   @b[1][2] = 6;
 4216   @b[2][1] = 7;
 4217   @b[2][2] = 8;
 4218   emitp (@a, @b), "s", "t"
 4219 }'
 4220 
 4221 run_mlr -n put 'end {
 4222   @a[1][1] = 1;
 4223   @a[1][2] = 2;
 4224   @a[2][1] = 3;
 4225   @a[2][2] = 4;
 4226   @a[3] = 10;
 4227   @a[4] = 11;
 4228   @a[5][6][7] = 12;
 4229   @b[1][1] = 5;
 4230   @b[1][2] = 6;
 4231   @b[2][1] = 7;
 4232   @b[2][2] = 8;
 4233   emitp (@a, @b), "s", "t"
 4234 }'
 4235 
 4236 run_mlr -n put 'end {
 4237   @a[1][1] = 1;
 4238   @a[1][2] = 2;
 4239   @a[2][1] = 3;
 4240   @a[2][2] = 4;
 4241   @a[3] = 10;
 4242   @a[4] = 11;
 4243   @a[5][6][7] = 12;
 4244   @b[1][1] = 5;
 4245   @b[1][2] = 6;
 4246   @b[2][1] = 7;
 4247   @b[2][2] = 8;
 4248   emitp (@b, @a), "s", "t"
 4249 }'
 4250 
 4251 
 4252 run_mlr -n put 'end {
 4253   @a[1][2][3] = 4;
 4254   @b[5][2][3] = 8;
 4255   emitp (@a[1], @b[3]), "t", "u"
 4256 }'
 4257 
 4258 run_mlr -n put 'end {
 4259   @a[1][2][3] = 4;
 4260   @b[5][2][3] = 8;
 4261   emitp (@a[1][2], @b[5][9]), "t", "u"
 4262 }'
 4263 
 4264 run_mlr -n put 'end {
 4265   @a[1][2][3] = 4;
 4266   @b[5][2][3] = 8;
 4267   emitp (@a[1][2], @b[9][2]), "t", "u"
 4268 }'
 4269 
 4270 run_mlr -n put 'end {
 4271   @a[1][2][3] = 4;
 4272   @b[5][2][3] = 8;
 4273   emitp (@a[9], @b[5]), "t", "u"
 4274 }'
 4275 
 4276 # ----------------------------------------------------------------
 4277 announce CANONICAL LASHED EMIT
 4278 
 4279 run_mlr --from $indir/abixy-wide --opprint put -q '
 4280   @count[$a] += 1;
 4281   @sum[$a] += $x;
 4282   end {
 4283       for (a, c in @count) {
 4284           @mean[a] = @sum[a] / @count[a]
 4285       }
 4286       emit (@sum, @count, @mean), "a"
 4287   }
 4288 '
 4289 
 4290 run_mlr --from $indir/abixy-wide --opprint put -q '
 4291   @count[$a][$b] += 1;
 4292   @sum[$a][$b] += $x;
 4293   end {
 4294       for ((a, b), c in @count) {
 4295           @mean[a][b] = @sum[a][b] / @count[a][b]
 4296       }
 4297       emit (@sum, @count, @mean), "a", "b"
 4298   }
 4299 '
 4300 
 4301 # ----------------------------------------------------------------
 4302 announce MAP-VARIANT EMITS
 4303 
 4304 run_mlr         --from $indir/abixy-het --opprint put -q 'o=$a.$b; emit o'
 4305 run_mlr         --from $indir/abixy-het --opprint put -q 'o={"ab":$a.$b}; emit o'
 4306 
 4307 run_mlr         --from $indir/abixy-het --opprint put -q '@o=$a.$b; emit @o'
 4308 run_mlr         --from $indir/abixy-het --opprint put -q '@o={"ab":$a.$b}; emit @o'
 4309 
 4310 run_mlr         --from $indir/abixy-het --opprint put -q '@o=$a.$b; emit @*'
 4311 run_mlr         --from $indir/abixy-het --opprint put -q '@o={"ab":$a.$b}; emit @*'
 4312 
 4313 mlr_expect_fail --from $indir/abixy-het --opprint put -q 'emit $a.$b'
 4314 run_mlr         --from $indir/abixy-het --opprint put -q 'emit {"ab":$a.$b}'
 4315 
 4316 run_mlr         --from $indir/abixy-het --opprint put -q 'func f(a,b) { return a.b } o = f($a, $b); emit o'
 4317 run_mlr         --from $indir/abixy-het --opprint put -q 'func f(a,b) { return a.b } emit f($a, $b)'
 4318 
 4319 run_mlr         --from $indir/abixy-het --opprint put -q 'func f(a,b) { return {"ab": a.b} } o = f($a, $b); emit o'
 4320 run_mlr         --from $indir/abixy-het --opprint put -q 'func f(a,b) { return {"ab": a.b} } emit f($a, $b)'
 4321 
 4322 # ----------------------------------------------------------------
 4323 announce MAP-VARIANT LASHED EMITS
 4324 
 4325 # scalar emits aren't reasonable ... but they shouldn't segv
 4326 
 4327 mention scalar lashed emits
 4328 mlr_expect_fail --from $indir/abixy-het --opprint put -q 'emit ($a . "_" . $b, $x . "_" . $y)'
 4329 run_mlr         --from $indir/abixy-het --opprint put -q ' o = $a . "_" . $b;  p = $x . "_" . $y; emit  (o,  p)'
 4330 run_mlr         --from $indir/abixy-het --opprint put -q '@o = $a . "_" . $b; @p = $x . "_" . $y; emit (@o, @p)'
 4331 run_mlr         --from $indir/abixy-het --opprint put -q 'func f(a, b) { return a . "_" . b }  o = f($a, $b);  p = f($x, $y); emit  (o,  p)'
 4332 run_mlr         --from $indir/abixy-het --opprint put -q 'func f(a, b) { return a . "_" . b } @o = f($a, $b); @p = f($x, $y); emit (@o, @p)'
 4333 run_mlr         --from $indir/abixy-het --opprint put -q 'func f(a, b) { return a . "_" . b } emit (f($a, $b), f($x, $y))'
 4334 
 4335 mention non-scalar non-keyed lashed emits
 4336 run_mlr         --from $indir/abixy-het --opprint put -q 'emit ({"ab": $a . "_" . $b}, {"ab": $x . "_" . $y})'
 4337 run_mlr         --from $indir/abixy-het --opprint put -q ' o = {"ab": $a . "_" . $b};  p = {"ab": $x . "_" . $y}; emit  (o, p)'
 4338 run_mlr         --from $indir/abixy-het --opprint put -q '@o = {"ab": $a . "_" . $b}; @p = {"ab": $x . "_" . $y}; emit (@o, @p)'
 4339 run_mlr         --from $indir/abixy-het --opprint put -q 'func f(a, b) { return {"ab": a . "_" . b} }  o = f($a, $b);  p = f($x, $y); emit  (o, p)'
 4340 run_mlr         --from $indir/abixy-het --opprint put -q 'func f(a, b) { return {"ab": a . "_" . b} } @o = f($a, $b); @p = f($x, $y); emit (@o, @p)'
 4341 run_mlr         --from $indir/abixy-het --opprint put -q 'func f(a, b) { return {"ab": a . "_" . b} } emit (f($a, $b), f($x, $y))'
 4342 
 4343 mention non-scalar non-keyed lashed emits
 4344 run_mlr         --from $indir/abixy-het --opprint put -q 'emitp ({"ab": $a . "_" . $b}, {"ab": $x . "_" . $y})'
 4345 run_mlr         --from $indir/abixy-het --opprint put -q ' o = {"ab": $a . "_" . $b};  p = {"ab": $x . "_" . $y}; emitp  (o, p)'
 4346 run_mlr         --from $indir/abixy-het --opprint put -q '@o = {"ab": $a . "_" . $b}; @p = {"ab": $x . "_" . $y}; emitp (@o, @p)'
 4347 run_mlr         --from $indir/abixy-het --opprint put -q 'func f(a, b) { return {"ab": a . "_" . b} }  o = f($a, $b);  p = f($x, $y); emitp  (o, p)'
 4348 run_mlr         --from $indir/abixy-het --opprint put -q 'func f(a, b) { return {"ab": a . "_" . b} } @o = f($a, $b); @p = f($x, $y); emitp (@o, @p)'
 4349 run_mlr         --from $indir/abixy-het --opprint put -q 'func f(a, b) { return {"ab": a . "_" . b} } emit (f($a, $b), f($x, $y))'
 4350 
 4351 mention non-scalar keyed lashed emits
 4352 run_mlr         --from $indir/abixy-het --opprint put -q 'emit ({"ab": $a . "_" . $b}, {"ab": $x . "_" . $y}), "ab"'
 4353 run_mlr         --from $indir/abixy-het --opprint put -q ' o = {"ab": $a . "_" . $b};  p = {"ab": $x . "_" . $y}; emit  (o, p), "ab"'
 4354 run_mlr         --from $indir/abixy-het --opprint put -q '@o = {"ab": $a . "_" . $b}; @p = {"ab": $x . "_" . $y}; emit (@o, @p), "ab"'
 4355 run_mlr         --from $indir/abixy-het --opprint put -q 'func f(a, b) { return {"ab": a . "_" . b} }  o = f($a, $b);  p = f($x, $y); emit  (o, p), "ab"'
 4356 run_mlr         --from $indir/abixy-het --opprint put -q 'func f(a, b) { return {"ab": a . "_" . b} } @o = f($a, $b); @p = f($x, $y); emit (@o, @p), "ab"'
 4357 run_mlr         --from $indir/abixy-het --opprint put -q 'func f(a, b) { return {"ab": a . "_" . b} } emit (f($a, $b), f($x, $y)), "ab"'
 4358 
 4359 mention non-scalar keyed lashed emits
 4360 run_mlr         --from $indir/abixy-het --opprint put -q 'emitp ({"ab": $a . "_" . $b}, {"ab": $x . "_" . $y}), "ab"'
 4361 run_mlr         --from $indir/abixy-het --opprint put -q ' o = {"ab": $a . "_" . $b};  p = {"ab": $x . "_" . $y}; emitp  (o, p), "ab"'
 4362 run_mlr         --from $indir/abixy-het --opprint put -q '@o = {"ab": $a . "_" . $b}; @p = {"ab": $x . "_" . $y}; emitp (@o, @p), "ab"'
 4363 run_mlr         --from $indir/abixy-het --opprint put -q 'func f(a, b) { return {"ab": a . "_" . b} }  o = f($a, $b);  p = f($x, $y); emitp  (o, p), "ab"'
 4364 run_mlr         --from $indir/abixy-het --opprint put -q 'func f(a, b) { return {"ab": a . "_" . b} } @o = f($a, $b); @p = f($x, $y); emitp (@o, @p), "ab"'
 4365 run_mlr         --from $indir/abixy-het --opprint put -q 'func f(a, b) { return {"ab": a . "_" . b} } emitp (f($a, $b), f($x, $y)), "ab"'
 4366 
 4367 # ----------------------------------------------------------------
 4368 announce MAPPER NOTHING
 4369 
 4370 run_mlr cat then nothing < $indir/abixy
 4371 run_mlr cat then nothing   $indir/abixy
 4372 run_mlr tac then nothing   $indir/abixy
 4373 run_mlr cat then nothing   $indir/abixy $indir/abixy
 4374 run_mlr cat then nothing then cat $indir/abixy
 4375 
 4376 # ----------------------------------------------------------------
 4377 announce IN-PLACE PROCESSING
 4378 
 4379 cp $indir/abixy $outdir/abixy.temp1
 4380 cp $indir/abixy $outdir/abixy.temp2
 4381 run_cat $outdir/abixy.temp1
 4382 run_cat $outdir/abixy.temp2
 4383 run_mlr -I --opprint head -n 2 $outdir/abixy.temp1 $outdir/abixy.temp2
 4384 run_cat $outdir/abixy.temp1
 4385 run_cat $outdir/abixy.temp2
 4386 
 4387 mlr_expect_fail -I --opprint head -n 2 < $outdir/abixy.temp1
 4388 mlr_expect_fail -I --opprint -n head -n 2 $outdir/abixy.temp1
 4389 
 4390 cp $indir/abixy $outdir/abixy.temp1
 4391 cp $indir/abixy $outdir/abixy.temp2
 4392 run_cat $outdir/abixy.temp1
 4393 run_cat $outdir/abixy.temp2
 4394 run_mlr -I --opprint rename a,AYE,b,BEE $outdir/abixy.temp1 $outdir/abixy.temp2
 4395 run_cat $outdir/abixy.temp1
 4396 run_cat $outdir/abixy.temp2
 4397 
 4398 # ----------------------------------------------------------------
 4399 announce MAPPER TEE REDIRECTS
 4400 
 4401 tee1=$reloutdir/tee1
 4402 mkdir -p $tee1
 4403 
 4404 run_mlr --from $indir/abixy tee $tee1/out then nothing
 4405 run_cat $tee1/out
 4406 
 4407 run_mlr --from $indir/abixy tee --no-fflush $tee1/out then nothing
 4408 run_cat $tee1/out
 4409 
 4410 run_mlr --from $indir/abixy tee -a $tee1/out then nothing
 4411 run_cat $tee1/out
 4412 
 4413 run_mlr --from $indir/abixy tee -o json $tee1/out then nothing
 4414 run_cat $tee1/out
 4415 
 4416 # ----------------------------------------------------------------
 4417 announce DSL TEE REDIRECTS
 4418 
 4419 tee2=$reloutdir/tee2
 4420 mkdir -p $tee2
 4421 
 4422 run_mlr put -q 'tee > "'$tee2'/out.".$a, $*' $indir/abixy
 4423 run_cat $tee2/out.eks
 4424 run_cat $tee2/out.hat
 4425 run_cat $tee2/out.pan
 4426 run_cat $tee2/out.wye
 4427 run_cat $tee2/out.zee
 4428 
 4429 run_mlr put -q --no-fflush 'tee > "'$tee2'/out.".$a, $*' $indir/abixy
 4430 run_cat $tee2/out.eks
 4431 run_cat $tee2/out.hat
 4432 run_cat $tee2/out.pan
 4433 run_cat $tee2/out.wye
 4434 run_cat $tee2/out.zee
 4435 
 4436 run_mlr put -q 'tee >> "'$tee2'/out.".$a