Skip to content

Contradiction in specification regarding FOR. #50

@python-processing-unit

Description

@python-processing-unit

According to the specification section 4:

The FOR construct has the form FOR(counter, target){ block }, where counter is an identifier and target is an expression. At loop entry, target is evaluated once to a value T (MUST be INT), and counter is initialized to the INT value 1, creating it as an INT if necessary. The loop then repeats: if the current value of counter is greater than T, the loop exits; otherwise, the block executes and counter is incremented by 1 before the next iteration.

However, according to the specification section 12.20:

  • FOR(counter, INT: target){ block } ; counter initialized to 0, loop until counter >= target

The note is section 4 is correct, and is used in the current implementations.

Modify section 12.2 so it is consistent with section 4 in regards to FOR loop counter initialization.

Metadata

Metadata

Labels

bugSomething isn't workingdocumentationImprovements or additions to documentation

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions