
mlr --json --from ./reg-test/input/for-multi.json put -q 
  @data = $*;
  for (k in @*) {
    print "k: ".k
  }

k: data
k: data
k: data

mlr --json --from ./reg-test/input/for-multi.json put -q 
  @data = $*;
  for (k,v in @*) {
    print
      "k: ".k." ".
      "v:".v;
  }

k: data v:{
  "a": {
    "x": 1,
    "y": 2
  },
  "b": {
    "x": 3,
    "y": 4
  }
}
k: data v:{
  "a": {
    "x": 5,
    "y": 6
  },
  "b": {
    "x": 7
  }
}
k: data v:{
  "b": {
    "x": 8,
    "y": 9
  }
}

mlr --json --from ./reg-test/input/for-multi.json put -q 
  @data = $*;
  for (k,v in @data) {
    print
      "k: ".k." ".
      "v:".v;
  }

k: a v:{
  "x": 1,
  "y": 2
}
k: b v:{
  "x": 3,
  "y": 4
}
k: a v:{
  "x": 5,
  "y": 6
}
k: b v:{
  "x": 7
}
k: b v:{
  "x": 8,
  "y": 9
}

mlr --json --from ./reg-test/input/for-multi.json put -q 
  @data = $*;
  for (k,v in @data["a"]) {
    print
      "k: ".k." ".
      "v:".v;
  }

k: x v:1
k: y v:2
k: x v:5
k: y v:6
Miller: looped-over item is not a map or array.

mlr --json --from ./reg-test/input/for-multi.json put -q 
  @data = $*;
  for ((k1,k2),v in @*) {
    print
      "k1: ".k1." ".
      "k2: ".k2." ".
      "v:".v;
  }

k1: data k2: a v:{
  "x": 1,
  "y": 2
}
k1: data k2: b v:{
  "x": 3,
  "y": 4
}
k1: data k2: a v:{
  "x": 5,
  "y": 6
}
k1: data k2: b v:{
  "x": 7
}
k1: data k2: b v:{
  "x": 8,
  "y": 9
}

mlr --json --from ./reg-test/input/for-multi.json put -q 
  @data = $*;
  for ((k1,k2),v in @data) {
    print
      "k1: ".k1." ".
      "k2: ".k2." ".
      "v:".v;
  }

k1: a k2: x v:1
k1: a k2: y v:2
k1: b k2: x v:3
k1: b k2: y v:4
k1: a k2: x v:5
k1: a k2: y v:6
k1: b k2: x v:7
k1: b k2: x v:8
k1: b k2: y v:9

mlr --json --from ./reg-test/input/for-multi.json put -q 
  @data = $*;
  for ((k1,k2,k3),v in @*) {
    print
      "k1: ".k1." ".
      "k2: ".k2." ".
      "k3: ".k3." ".
      "v:".v;
  }

k1: data k2: a k3: x v:1
k1: data k2: a k3: y v:2
k1: data k2: b k3: x v:3
k1: data k2: b k3: y v:4
k1: data k2: a k3: x v:5
k1: data k2: a k3: y v:6
k1: data k2: b k3: x v:7
k1: data k2: b k3: x v:8
k1: data k2: b k3: y v:9

mlr --json --from ./reg-test/input/for-multi.json put -q 
  @data = $*;
  for ((k1,k2,k3),v in @*) {
    print
      "k1: ".k1." ".
      "k2: ".k2." ".
      "k3: ".k3." ".
      "v:".v;
    if (v == 5) {
      break
    }
  }

k1: data k2: a k3: x v:1
k1: data k2: a k3: y v:2
k1: data k2: b k3: x v:3
k1: data k2: b k3: y v:4
k1: data k2: a k3: x v:5
k1: data k2: b k3: x v:7
k1: data k2: b k3: x v:8
k1: data k2: b k3: y v:9

mlr --json --from ./reg-test/input/for-multi.json put -q 
  @data = $*;
  for ((k1,k2,k3),v in @data) {
    print
      "k1: ".k1." ".
      "k2: ".k2." ".
      "k3: ".k3." ".
      "v:".v;
  }

Miller: looped-over item is not a map or array.

