Skip to content

Add multi-iterable for zip iteration #39

Description

@synapticvoid

Summary

Extend for to support multiple bindings and multiple iterables with zip semantics.

Proposed Syntax

for a, b in xs, ys {
    print(a, b);
}

Semantics

  • N bindings + N iterables, positionally matched
  • Iteration stops at the shortest iterable
  • Body scope includes all bound variables

Scope

  • Parser/type-checker/runtime support for multi-binding + multi-iterable form
  • Type inference per binding from corresponding iterable element type

Out of Scope

  • Destructuring bindings
  • Range/index sugar (tracked separately)

Acceptance Criteria

  • for a, b in [1,2], [\"x\",\"y\"] { ... } works
  • Stops at shortest iterable when lengths differ
  • Type errors for binding/iterable arity mismatch

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