File tree Expand file tree Collapse file tree 3 files changed +29
-24
lines changed
Expand file tree Collapse file tree 3 files changed +29
-24
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ print(vecs)
1616
1717### Bugs
1818
19- - struct access is still random
19+ - struct constructor is still random
2020- print function calls just aren't executing
2121
2222### Non functional features
Original file line number Diff line number Diff line change 55std = import std
66p = std.io.print
77
8- Iterator type
9- counter: u32
10- limit: u32
11- end
12-
13- __iter fn(self: Iterator)
14- // self.counter = self.counter + 1
15- end
16-
178i = Iterator(0,10)
18- // i.__iter()
19-
20-
21- // why is this print not working!!!
22-
23- std.io.print(i.counter)
9+ res = i.__iter()
10+ res = i.__iter()
11+ res = i.__iter()
12+ res = i.__iter()
13+ res = i.__iter()
14+ res = i.__iter()
15+ res = i.__iter()
16+ res = i.__iter()
17+ res = i.__iter()
18+ res = i.__iter()
19+
20+ std.io.print(res)
Original file line number Diff line number Diff line change @@ -3,17 +3,25 @@ Error type
33 msg: string
44end
55
6-
7- // Result = type $T | Error end
8-
9- Result type
10- is_ok: bool
11- end
12-
13-
146// what this gets compiled to is
157// __result = my_fn()
168// if !__result.is_ok
179// return __result
1810// end
1911// r = __result.data
12+ //
13+ // Eventually we may want an algebraic data type like so
14+ // Result = type $T | Error end
15+ Result type
16+ is_ok: bool
17+ end
18+
19+ Iterator type
20+ counter: u32
21+ limit: u32
22+ end
23+
24+ __iter fn(self: Iterator) -> bool
25+ self.counter = self.counter + 1
26+ return self.counter == self.limit
27+ end
You can’t perform that action at this time.
0 commit comments