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

topdown/EE: EE with in operator #4037

Open
srenatus opened this issue Nov 18, 2021 · 2 comments
Open

topdown/EE: EE with in operator #4037

srenatus opened this issue Nov 18, 2021 · 2 comments

Comments

@srenatus
Copy link
Contributor

srenatus commented Nov 18, 2021

Currently, the in operator is implemented via the internal.member_2 and internal.member_3 built-in functions. That way, the evaluator has the evaluate the operands of x, y in xs in full, and invokes the function with them.

While the internal.member_{2,3} functions stop after the first match, evaluating the operands fully still can be some work that could be avoided.

p {
  "foo" in q
}

q["foo"] {
  print("foo")
}
q["bar"] {
  print("bar")
}

☝️ This should only print "foo".

This is semantically related to #4035, but the underlying structures and changes are different, because of the built-in function implementation.

@srenatus
Copy link
Contributor Author

This is pretty much the same issue as #3948.... 💭

@stale
Copy link

stale bot commented Dec 18, 2021

This issue has been automatically marked as inactive because it has not had any activity in the last 30 days.

@stale stale bot added the inactive label Dec 18, 2021
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

1 participant