github.com/solo-io/cue@v0.4.7/cue/testdata/eval/lists.txtar (about)

     1  -- in.cue --
     2  a: [...int]
     3  a: [1, 2, 3, 5]
     4  a: [1, 2, 3, d]
     5  
     6  b: a[3]
     7  d: 5
     8  
     9  c: [for x in [[1, 2]][0] { x + d }]
    10  
    11  -- out/eval --
    12  (struct){
    13    a: (#list){
    14      0: (int){ 1 }
    15      1: (int){ 2 }
    16      2: (int){ 3 }
    17      3: (int){ 5 }
    18    }
    19    b: (int){ 5 }
    20    d: (int){ 5 }
    21    c: (#list){
    22      0: (int){ 6 }
    23      1: (int){ 7 }
    24    }
    25  }
    26  -- out/compile --
    27  --- in.cue
    28  {
    29    a: [
    30      ...int,
    31    ]
    32    a: [
    33      1,
    34      2,
    35      3,
    36      5,
    37    ]
    38    a: [
    39      1,
    40      2,
    41      3,
    42      〈0;d〉,
    43    ]
    44    b: 〈0;a〉[3]
    45    d: 5
    46    c: [
    47      for _, x in [
    48        [
    49          1,
    50          2,
    51        ],
    52      ][0] {
    53        (〈1;x〉 + 〈2;d〉)
    54      },
    55    ]
    56  }