Skip to content

Deprecate many/match_many option from the argument processor #540

Open
@SamirDroubi

Description

@SamirDroubi

The many option currently exists for the StmtCursorA, ExprCursorA, and BlockCursorA processors. However, it is virtually not used anywhere in our code except for two places, which themsevles can be deprecated.

First usage:

@sched_op([ExprCursorA(many=True), NameA, BoolA])
def bind_expr(proc, expr_cursors, new_name, cse=False):

When we specify cse=True, then we would perform CSE on all expressions that match the pattern. Otherwise, it will simply bind the first expressions that matches the pattern. I think generally implementing this as ListOrElemA(NewExprA)) would make more sense. If I want to replicate the old behavior, I can simply call Procedure::find(pat, many=True) and pass that as an argument.

Second usage:

@sched_op([ExprCursorA(many=True)])
def commute_expr(proc, expr_cursors):

This simply loops through all the cursors and commutes each one. It can be changed to work for exactly one expression and replicate the looping functionality using high-order operations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: APIsThe API exposed by the languageS: Needs DiscussionThis needs discussion to decide if important to work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions