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 tuples to the language #7

Closed
Victorious3 opened this issue Sep 23, 2022 · 1 comment
Closed

Add tuples to the language #7

Victorious3 opened this issue Sep 23, 2022 · 1 comment
Labels
proposal New feature or request
Milestone

Comments

@Victorious3
Copy link
Contributor

Currently the parser only knows quasi tuple syntax for function returns:

def function -> int, int

This is already implemented using a Tuple type. It should be trivial to allow the use of tuples outside of function context.

var t1: (int, int) = (10, 20)
var t2: (int,) = (10,)    // Single elements like python

The parser already does build a list of types for function types, the way to go would be to check if the next token is an -> and pick a function type in that case and a tuple type in the other.

@Victorious3 Victorious3 added the proposal New feature or request label Sep 23, 2022
@Victorious3 Victorious3 added this to the 0.5 milestone Nov 17, 2023
@Victorious3
Copy link
Contributor Author

Related to #36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant