Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treatment of big-E Expression objects in expression walkers (Feedback requested) #452

Closed
carldlaird opened this issue Apr 27, 2018 · 4 comments

Comments

@carldlaird
Copy link
Member

From comment on PR #272

"Further, in the walkers, sometimes named expressions are treated as leaf nodes and sometimes they are not. This is one of the big sources of confusion for the walkers, as there are operations where a reasonable user would sometimes want the Expression to be a leaf and sometimes for it to be an internal node. Two big examples of this are string generation and substitution."

I agree that there are times it is reasonable to treat the Expression objects one way and times it is reasonable to treat them another. Please post your design thoughts here.

Possible ideas:

  • extend the walkers to include flags that can be set by derived classes to determine behavior
  • others?
@whart222
Copy link
Member

IMHO, these customizations are not necessary. There currently are two methods that determine the behavior of the walkers, and this control is determined within those methods. Thus, there's nothing in the normal walker logic that is specific to the object type.

An exception are the replacement walkers, where by design I've hard-coded a lot of decisions into the walker itself. But those decisions merely control how new expression nodes are created after modifying children. Again, the two methods control whether the walker terminates at a node.

@carldlaird
Copy link
Member Author

OK. It is exactly this last point where the immediate questions lie.

But those decisions merely control how new expression nodes are created after modifying children.

I can see cases where people would want to perform a substitution and have the big-E Expression object stick, and I can see cases where people would want the big-E expression object to be removed after the substitution. So it is exactly the issue you bring up that may need to be addressed.

@mrmundt
Copy link
Contributor

mrmundt commented Jan 3, 2024

In an effort to clean up old issues, we are moving some design discussions to our Archived Design Discussions wiki.

@mrmundt mrmundt closed this as completed Jan 3, 2024
@jsiirola
Copy link
Member

jsiirola commented Jan 5, 2024

Note that this appeared to be a duplicate of #416

@blnicho blnicho closed this as not planned Won't fix, can't repro, duplicate, stale Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants