Skip to content

Support "do while" loops #1313

Closed
Closed
@mdinger

Description

@mdinger

Sometimes you want to check the condition at the end and not the beginning.

do {
   do_work();  
} while condition

These substitutes are less than ideal:

do_work();
while condition {
   do_work();
}

loop {
   do_work();
   if !condition { break }
}

A do while loop would be nice in these cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-langRelevant to the language team, which will review and decide on the RFC.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions