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

Support T[x,y,z] patterns for arrays #94

Open
nystrom opened this issue Sep 27, 2023 · 2 comments
Open

Support T[x,y,z] patterns for arrays #94

nystrom opened this issue Sep 27, 2023 · 2 comments

Comments

@nystrom
Copy link
Collaborator

nystrom commented Sep 27, 2023

This is supported:

xs = [1,2,3]
@match xs begin
    [x,y,z] => ...
    ...
end

but not this:

xs = [1,2,3]
@match xs begin
    Int[x,y,z] => ...
    ...
end
@gafter
Copy link
Member

gafter commented Oct 5, 2023

@nystrom Is this just an idea, or do you have a use case where this would be helpful to you?

@nystrom
Copy link
Collaborator Author

nystrom commented Jun 4, 2024

Not really a use case, but I want to avoid bare arrays in my code since they lead to problems with type inference. This is not a problem in patterns, but would make the pattern syntax match the expression syntax.

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

2 participants