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 tuples to have rest type #51

Closed
jclark opened this issue Mar 29, 2019 · 3 comments
Closed

Allow tuples to have rest type #51

jclark opened this issue Mar 29, 2019 · 3 comments
Labels
Area/Lang Relates to the Ballerina language specification Type/Improvement Enhancement to language design
Milestone

Comments

@jclark
Copy link
Collaborator

jclark commented Mar 29, 2019

Records can specify a rest type, but tuples cannot. It might be useful to allow this, e.g.

type T (boolean, int...);

This relates to #33, for which this might be needed, depending on the resolution to #27 .

@jclark jclark added Type/Improvement Enhancement to language design Area/Lang Relates to the Ballerina language specification labels Mar 29, 2019
@jclark jclark added this to the 2019R1 milestone Mar 29, 2019
@jclark
Copy link
Collaborator Author

jclark commented Mar 29, 2019

We would also need to add this as a binding pattern and a match pattern. Tuple types would work similarly to closed record types (as delimited by {| |}).

@jclark
Copy link
Collaborator Author

jclark commented Apr 10, 2019

Given the way we have resolved #27, this is what is needed to fix #33.

@jclark
Copy link
Collaborator Author

jclark commented Apr 11, 2019

This also raises the question of what is the difference between a tuple constructor (using round parentheses) and an array constructor (using square brackets). Also relates to #54.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/Lang Relates to the Ballerina language specification Type/Improvement Enhancement to language design
Projects
None yet
Development

No branches or pull requests

1 participant