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

[Idea]: Partial structural matching #609

Open
Catya3 opened this issue May 9, 2024 · 4 comments
Open

[Idea]: Partial structural matching #609

Catya3 opened this issue May 9, 2024 · 4 comments

Comments

@Catya3
Copy link
Collaborator

Catya3 commented May 9, 2024

In a structural type system I should expect to use Match<stream<int>> to do this:

... -> match:data // pass stream to data
{last: true} -> match:case[0] -> :stop

That is it should match on the partial contents of the struct. What I actually got is:

{"data": 50, "idx": 0, "last": true}
panic: runtime error: comparing uncomparable type runtime.MapMsg

@Catya3 Catya3 changed the title [Idea] Structural matching [Idea]: Partial structural matching May 9, 2024
@Catya3 Catya3 added the Idea label May 9, 2024
@emil14
Copy link
Collaborator

emil14 commented May 10, 2024

Seems like both Eq (if we gonna have one) and Match should implement this

@emil14
Copy link
Collaborator

emil14 commented May 10, 2024

@Catya3 is this how Rust works?

{last: true} -> match:case[0] -> :stop

@emil14
Copy link
Collaborator

emil14 commented May 22, 2024

@Catya3 do we need this issue if we have #613 ?

Is this issue about something else except structures? Is (partial) pattern matching working in e.g. Rust for smt else?

@Catya3
Copy link
Collaborator Author

Catya3 commented May 22, 2024

No I think this can be closed

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