The definition for an array being set is from bash manual: An array variable is considered set if a subscript has been assigned a value. The null string is a valid value.Does it mean that an array is set if and only if the number of its elements isgreater than zero?Is the following array set, myarr=()?The manual also saysA parameter is set if it has been assigned a value. The null string is a valid value. Since an array is also a parameter, how does the definition of an array being set agree with the definition of a parameter being set? For example, myvar= is set, but is myarr=() set? Has myarr been assigned a value, which is null?There is a different definition for an array being set from https://unix.stackexchange.com/a/246703/674For shells that support arrays, except for yash and zsh that would not report as set array variables unless the element of indice 0 has  been set.For bash (but not ksh93 nor zsh), for variables of type associative array, that would not report them as set unless their  element of key 0 has been set.Is this definition incorrect, because an array name withoutsubscription actually refers to the element indexed by index/key 0instead of referring to the entire array, according to Bash manualReferencing an  array variable without a subscript is equivalent to referencing with a subscript of 0.So is this definitionactually for the element indexed by index/key 0 being set, not for the array being set?For example, ${myarr+1} and [[ -v myarr ]] are the applications  to an array myarr the usual ways of testing if a variable/parameter is set. Which does myarr in  them mean: myarr[0], or the entire array myarr?What is POSIX definition for a shell array being set?
What is the definition of an array being set?
bash