type Range_int(start: int, end: int, current: int); func range(start: int, end: int) -> Range_int { Range_int(start: start, end: end, current: start) } func advance(r: Range_int) -> Range_int { // FIXME: Inline this in the line after once parsing is fixed old_current = r.current; new_current = old_current + 1; new_start = r.start; new_end = r.end; Range_int(start: new_start, end: new_end, current: new_current) } func current(r: Range_int) -> Maybe_int { old_current = r.current; mut old_end = r.end; old_end = old_end - 1; gone_past = old_current > old_end; // FIXME: Once #320 is fixed, replace // if r.current > r.end - 1 { if gone_past { nothing() } else { some(r.current) } }