mathiasvatter / cksp-compiler-issues

Issues-only repository of the ksp-compiler
0 stars 0 forks source link

Implement foreach loops with local key, value pairs #7

Closed mathiasvatter closed 8 months ago

mathiasvatter commented 8 months ago

Feature Description lua/python type for each loop for arrays

Problem it Solves More user friendly array iteration

Proposed Solution Syntactic Sugar:

declare note_id[128] := (10)
for _, value in node_id
    message(value)
end for

Desugared:

for _ := 0 to num_elements(node_id)-1
    message(node_id[_])
end for
mathiasvatter commented 8 months ago

Added in v0.0.3