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

define specialized [in|all|any](x, ::Tuple) methods with better effects #51002

Merged
merged 1 commit into from
Aug 24, 2023

Conversation

aviatesk
Copy link
Member

@aviatesk aviatesk commented Aug 22, 2023

So that it can be concrete-evaluated.
There are certain code patterns like:

if flag::Const(::Char) in ('S', 'T', 'U')
    # do something
else
    # do something else
end

and it would be beneficial if we can cut off a dead branch by folding
the call to in.
This commit adds similar improvements for all and any as well.

@aviatesk aviatesk changed the title define specialized x in itr::Tuple method with better effects define specialized [in|all|any](x, ::Tuple) methods with better effects Aug 22, 2023
base/operators.jl Outdated Show resolved Hide resolved
@brenhinkeller brenhinkeller added the collections Data structures holding multiple items, e.g. sets label Aug 23, 2023
So that it can be concrete-evaluated.
There are certain code patterns like:
```julia
if flag::Const(::Char) in ('S', 'T', 'U')
    # do something
else
    # do something else
end
```
and it would be beneficial if we can cut off a dead branch by folding
the call to `in`.
This commit adds similar improvements for `all` and `any` as well.
@aviatesk aviatesk merged commit 231ca24 into master Aug 24, 2023
1 check passed
@aviatesk aviatesk deleted the avi/concrete-eval-in branch August 24, 2023 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
collections Data structures holding multiple items, e.g. sets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants