Skip to content
This repository was archived by the owner on May 22, 2023. It is now read-only.
This repository was archived by the owner on May 22, 2023. It is now read-only.

[Discuss][UX] IRFunctor vs ExprFunctor and other naming issues #187

Open
@slyubomirsky

Description

@slyubomirsky

As discussed in the community meeting, ExprMutator and ExprVisitor somewhat confusingly also traverse binding blocks, which are statements rather than expressions. What is even more interesting is that these inherit from ExprFunctor, which does not traverse binding blocks. By contrast, IRFunctor (which is only used in one place in the codebase) does traverse binding blocks, but is not the parent class of ExprMutator and ExprVisitor. The naming here is very confusing and should probably be straightened out.

There are a few routes we could take (these are not exhaustive):

  1. Eliminate ExprFunctor and rename ExprMutator and ExprVisitor to IRMutator and IRVisitor.
  2. Rename the current ExprMutator and ExprVisitor to IRMutator and IRVisitor but maintain the distinction.

The main question is whether we have a need for functors that operate only on exprs and not on bindings. Option 1 seems like it probably wouldn't cause problems in the current state of the codebase, but who knows what the future holds. If we go with option 2, should we have a visitor just for binding blocks (a StmtVisitor, say)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions