You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Was using the GitHub API to parse release objects within arrays within an object when I was unable to access elements at array index. Then realised I couldn't access it.
To Reproduce
From duck repl:
object = json_parse "{\"obj_array\": {\"obj\": [1, 2, 3]}}"
arr_rang = range 0 ${object.obj_array.obj.length}
#i = set 1
for i in ${arr_rang}
a00 = get_by_name object.obj_array.obj[i]
a01 = get_by_name object.obj_array.obj[${i}]
a02 = get_by_name ${object.obj_array.obj[i]}
a03 = get_by_name ${object.obj_array.obj[${i}]}
a04 = set ${object.obj_array.obj[${i}]}
a05 = set ${object.obj_array.obj[i]}
obj_array0 = set ${object.obj_array}
a06 = get_by_name obj_array0.obj[i]
a07 = get_by_name obj_array0.obj[${i}]
a08 = get_by_name ${obj_array0.obj[i]}
a09 = get_by_name ${obj_array0.obj[${i}]}
a10 = set ${obj_array0.obj[${i}]}
a11 = set ${obj_array0.obj[i]}
obj_array1 = get_by_name object.obj_array
a12 = get_by_name obj_array1.obj[i]
a13 = get_by_name obj_array1.obj[${i}]
a14 = get_by_name ${obj_array1.obj[i]}
a15 = get_by_name ${obj_array1.obj[${i}]}
a16 = set ${obj_array1.obj[${i}]}
a17 = set ${obj_array1.obj[i]}
echo i=${i} a00=${a00}, a01=${a01}, a02=${a02}, a03=${a03}, a04=${a04}, a05=${a05}, a06=${a06}, a07=${a07}, a08=${a08}, a09=${a09}, a10=${a10}, a11=${a11}, a12=${a12}, a13=${a13}, a14=${a14}, a15=${a15}, a16=${a16}, a16=${a16}, a17=${a17}
end
However this works just fine:
v = get_by_name object.obj_array.obj[1]
echo v=${v}
SamuelMarks
changed the title
Unable to access inner inner array from json_parse
Unable to access inner inner array from json_parse in a loop
Aug 4, 2024
Describe The Bug
Was using the GitHub API to parse release objects within arrays within an object when I was unable to access elements at array index. Then realised I couldn't access it.
To Reproduce
From
duck
repl:However this works just fine:
Error Stack
The text was updated successfully, but these errors were encountered: