Skip to content

Add for loop #1

@PoetaKodu

Description

@PoetaKodu

Status

Currently waiting for templates and concepts implementation to implement range-for

Checklist

  • Parsing of the default form for (init; cond; iter) body
  • Execution of the default form
  • Parsing of the range-for
  • Execution of the range-for

Default for

for (var i = 0; i < arr.size(); i += 1) {
    // body
}

general form:

for ( init-statement condition; iteration-statement) {
    // body
}

Range-for

for (elem of arr) {
    // elem is immutable copy of each arr element
}

general form:

for (variable-def-no-init of range) {

}
for (variable-name in indexed-range) {
    // variable-name is a key of each element in the indexed-range
    // indexed-range[variable-name] is a valid reference or value inside the range
}

// TODO: support for number range

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions