Skip to content

iter

iter

The current repository does not ship a stdlib/iter.tg module. There are no built-in iterator adapters such as map, filter, zip, or collect in the shipped stdlib.

Current status

ItemStatus
stdlib/iter.tg filenot present
iterator adaptersnot present
lazy iterator pipelinesnot present

Available patterns

You can express the same control flow manually with loops:

PatternCurrent tool
simple countingwhile
array traversalfor item in items
reductionlocal accumulator variables

Examples

func count_to(limit: i32) -> i32:
let index: i32 = 0
let total: i32 = 0
while (index < limit):
total = total + index
index = index + 1
return total
func sum_items(items: Array[i32]) -> i32:
let total: i32 = 0
for item in items:
total = total + item
return total
func any_negative(items: Array[i32]) -> bool:
for item in items:
if (item < 0):
return true
return false