0

I don't understand the following piece of code.

val array = new Array[INT](1..1000, ([i]:Point) => 0);
val dist = Dist.makeBlock(array.region);
val distArray = DistArray.make(dist, ([i]:Point) => array(i));

This is all. The expressions in () are very confusing, but also the =>, Dist and DistArray.

Luca T.
  • 1,641
  • 1
  • 14
  • 18
  • I have edited your title. Please see, "[Should questions include “tags” in their titles?](http://meta.stackexchange.com/questions/19190/)", where the consensus is "no, they should not". – John Saunders Mar 24 '15 at 20:37

1 Answers1

0

Array initializers like ([i]:Point) => 0 are function literals (also called closures), and are described in section 10.3 of the X10 language specification. Dist and DistArray support a flexible mapping of multidimensional regions to distributed data; these classes are described in Chapter 16 of the spec.

Josh Milthorpe
  • 956
  • 1
  • 14
  • 27