title: Why ever use zsh array-parameters?
body: <pre><code>list=(1 2 3)
  for i in $list; do echo $i; done;
  for i in $list[@]; do echo $i; done;
  for i in $list[*]; do echo $i; done;
  for i in ${list}; do echo $i; done;
  for i in ${list[@]}; do echo $i; done;
  for i in ${list[*]}; do echo $i; done;
  for i in "${list[@]}"; do echo $i; done;
  </code></pre>
  
  <p>All of these print the same thing: </p>
  
  <pre><code>1 
  2
  3
  </code></pre>
  
  <p>These</p>
  
  <pre><code>for i in "$list"; do echo $i; done;
  for i in "${list}"; do echo $i; done;
  for i in "$list[*]"; do echo $i; done;
  for i in "${list[*]}"; do echo $i; done;
  </code></pre>
  
  <p>all print</p>
  
  <pre><code>1 2 3
  </code></pre>
  
  <p>When should I use brackets vs. no brackets and <code>@</code> vs. <code>*</code>? For example, I <a href="http://zsh.sourceforge.net/Doc/Release/Parameters.html#Array-Parameters" rel="nofollow noreferrer">know the difference between</a> <code>"${list[@]}"</code> and <code>"${list[*]}"</code>, but I have not been able to find a straightforward answer on the difference between <code>$list</code>, <code>${list}</code>, <code>$list[@]</code>, <code>${list[@]}</code>, <code>$list[*]</code>, and <code>${list[*]}</code>. Why would I ever use array parameters when I could just do <code>$list</code>? </p>
  
  <p>Similarly, why wouldn't I just <code>"$list"</code> when I want all of the elements in the array in one string? In that case I have, insanely, <strong>4</strong> different options: <code>"$list"</code>, <code>"${list}"</code>, <code>"$list[*]"</code>, <code>"${list[*]}"</code>.   </p>