Skip to content

§13.6 vs §13.6a: one comprehension family is promised, but Option/Result get a second syntax and the bracket form over an Option is refused #2960

Closed

Description

@ehartford

Errata #2955 item 4. §13.6: "There is one comprehension family, polymorphic over its target". §13.6a: Option and Result comprehensions are for x in a; y in b: yield x + y (statement form without yield), and the compiler refuses [x + y for x in a for y in b] with "a for over an Option or Result is a one-clause comprehension (§13.6a)". Either the bracket form admits Option/Result carriers (one family, as §13.6 says) or §13.6 stops claiming one family. Eric's ruling.

Activity

  1. ehartford commented on Nov 2, 2026

    @ehartford
    ContributorAuthor

    D185: ruled (spec v7.35, #2970): the bracket form over Option/Result yields the carrier of the element; the yield expression form is retired; the statement form stays. Implementation next.

  2. added a commit that references this issue on Nov 2, 2026
  3. ehartford commented on Nov 2, 2026

    @ehartford
    ContributorAuthor

    Implemented by #2990 under D185: the bracket comprehension over an Option or Result first clause yields the carrier of the element; the yield expression forms are retired; the statement form stays.

  4. added 2 commits that reference this issue on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions