【X10】IntRangeとRegionの違い

  • タグ:
  • x10
public class RegionTest {
    public static def main(Array[String]) {
        val range  = 0..2;
        val region = (0..2) as Region(1);
        for(x in range) {
            Console.OUT.println("x = " + x); // x is Int
        }   
        for(x in region) {
            Console.OUT.println("x = " + x); // x is Point
        }   
    }   
}