loom
27 строк · 581.0 Байт
1#{ initial_value : null } type
2Range =
3{
4begin : 0,
5end : 0,
6counter : 0,
7__init__ : fn [Range] (int : b, int : e) -> Range
8{
9def Range : range
10
11range.begin = b
12range.end = e
13range.counter = b - 1
14
15return range
16},
17__iterator__ : fn (Range : range)
18{
19range.counter += 1
20return [range.counter, range.counter <= range.end]
21}
22}
23
24for int : i in Range(1,4)
25print i
26
27print "Done"
28