On Mon, 17 Dec 2018, Brad Chamberlain wrote:

A couple of other notes here:

* Given an array declaration like `var A: [1..n] [1..3] real;`, there's
  been some confusion at points in the language's history about what
  indexing a slice expression should do: `A[2..n-1][2]` (in fact, you
  may have been involved in some of these conversations in the past?)

Sorry. Silly me. I keep changing between C++ and Chapel for testing. I have gotten out of that bad C++ habit for my Chapel work.

See below ....

  var xcoli : [1..n] real;

  for i in 1..n do
  {
   var R = i..m;

   xcoli[R] = x[R][i];

SHOULD BE

      xcoli[R] = x[R, i];

   // code which always refers to just xcoli[R]
   // so as to only use the slice over i..m

  }

AND

  for i in 1..n do
  {
   var R = i..m;
   var xcolii = x[R][i];

SHOULD BE

      var xcoli = X[R, i];

   // code can simply refer to xcoli because
   // it is by definition the slice over i..m

  }

Regards - Damian

Pacific Engineering Systems International, 277-279 Broadway, Glebe NSW 2037
Ph:+61-2-8571-0847 .. Fx:+61-2-9692-9623 | unsolicited email not wanted here
Views & opinions here are mine and not those of any past or present employer


_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers

Reply via email to