New Issue: Add support for 'for param' loop expressions

19627, "bradcray", "Add support for 'for param' loop expressions", "2022-04-12T20:31:50Z"

While writing some Chapel code this morning, I found that we don't currently support for param... expressions, which can be attractive in certain situations. Here's a toy motivator:

var A: [1..3] real = for param i in 1..3 do foo(i);

proc foo(param i: int) param {
  return i+1;

An obvious workaround for this is to write the array declaration as:

var A: [1..3] real;
for param i in 1..3 do
  A[i] = foo(i);

but the language features would feel more orthogonal if such loops could live in the initialization expression location as well.

This is somewhat related to #19336 in that both are examples of loop types that are currently only supported in statement form.