// it's unclear whether the end is inclusive or exclusive // (usually exclusive I guess) sclass IntRange { int start, end; *() {} *(int *start, int *end) {} *(IntRange r) { start = r.start; end = r.end; } [stdEq] final int length() { ret end-start; } final bool empty() { ret start >= end; } final bool isEmpty() { ret start >= end; } sS _fieldOrder = "start end"; toString { ret "[" + start + ";" + end + "]"; } bool contains(int i) { ret i >= start && i <= end; } }