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

Add support for tuple patterns #99

Closed
atomb opened this issue Feb 3, 2016 · 1 comment
Closed

Add support for tuple patterns #99

atomb opened this issue Feb 3, 2016 · 1 comment
Assignees

Comments

@atomb
Copy link
Contributor

atomb commented Feb 3, 2016

Right now, the only way to extract elements from a tuple is with positional selectors (x.0, etc.). It would be nice to allow pattern matching syntax, too, so you could do, for instance:

let f (x, y) = ...

or

(a, b) <- ...

and so on.

@atomb atomb added the next label Feb 3, 2016
brianhuffman pushed a commit that referenced this issue Feb 3, 2016
In saw-script, we now support tuple patterns in lambdas, monadic
bind statements (also at the REPL), and function declarations:

    \(x, y) -> e
    (x, y) <- e
    let f (x, y) = e

This mostly takes care of issue #99. However, this patch does not
include support for pattern bindings in declarations:

    let (x, y) = e  -- unsupported
@brianhuffman
Copy link
Contributor

Commit 46c4fc4 adds support for the forms of tuple binders mentioned above, as well as lambda binders like \(x, y) -> e. Support for declarations with pattern bindings like let (a, b) = ... is still missing, though. I'll close the ticket once I've implemented that as well.

@brianhuffman brianhuffman self-assigned this Feb 3, 2016
brianhuffman pushed a commit that referenced this issue Apr 26, 2021
@sauclovian-g sauclovian-g removed the next label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants