Skip to content

Clarify Expr.forEachWhere #2511

@Kha

Description

@Kha

As noted in #2491, the function docstring does not sufficiently explain its difference to forEach and in what circumstances one should use it. The module docstring gives more details, but is still misleading: it does not even mention the, I believe, main property of the function, f being applied at most once to each (structurally equal) subexpression. Thus a much more relevant question as to whether the function should be used might be whether f is much more expensive than p plus expr hashing.

Thus I propose to first confirm and document the intent of the function as well as consider renaming it (such as to forEachOnceWhere) before considering any refactors on top of it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P-lowWe are not planning to work on this issuedocumentationDocumentation improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions