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

Allow destructuring in binding position #127

Open
eholk opened this issue Jan 29, 2014 · 0 comments
Open

Allow destructuring in binding position #127

eholk opened this issue Jan 29, 2014 · 0 comments

Comments

@eholk
Copy link
Owner

eholk commented Jan 29, 2014

Unary ADTs is a pretty common pattern in Harlan as a way of getting structs and tuples. For these cases, it'd be nice to be able to destructure them in more than just match expressions, such as let and kernel. It'd be nice to do something like this:

(let (((point a b c) p))
  (+ a b c))

This would be equivalent to:

(match p
  ((point a b c) (+ a b c)))

It'd be especially nice for kernel parameters, for example.

This can probably be done mostly in the macro system.

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

1 participant