Skip to content

Semidet loops should produce the values of variables when they terminate #493

@pschachte

Description

@pschachte

For and do loops in a semidet context conjoin the tests in the loop body (and see #492 for a proposal to allow them to disjoin the tests). When they terminate, they should allow the values of the variables at the point they terminate to be available in subsequent code. This would allow disjunctive loops to be used to search for a value that satisfies the condition.

For conjunctive loops, the aim is to be able to find the first value for which the condition fails. The complication is that the loop fails in this case, so it does not produce any values, so there will need to be some workaround to this. Using while on the condition may be a partial solution, since failing the while condition terminates the loop without failing it, but there will still need to be a way to determine whether the loop terminated prematurely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions