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

Establishing , as list operator #45

Closed
phorward opened this issue Apr 6, 2022 · 1 comment
Closed

Establishing , as list operator #45

phorward opened this issue Apr 6, 2022 · 1 comment
Labels

Comments

@phorward
Copy link
Member

phorward commented Apr 6, 2022

In current Tokay v0.4, commas , are optional part of the syntax.

After some consideration, especially on #43, the idea came up that lists could generally by defined by separating commas, so the sequence 1 2 3 4 results in a list (1, 2, 3, 4), where 1 2, 3 4 actually could be interpretered as definitive list (2, 3) which is inside of a sequence, resulting in the list (1, (2, 3), 4).

This syntax is only allowed as SequenceItem or CollectionItem. Commas in parameter lists are still specified as they are, except when explicitly specified, so fn(1, (2,3), 4) provides 3 parameters.

@phorward phorward added the syntax label Apr 6, 2022
phorward added a commit to phorward/tokay that referenced this issue Apr 6, 2022
This is a solution for tokay-lang#43 but also should be improved by tokay-lang#45.
Fixed tokay.tok as well to accept for empty collections, as parser.rs does.
@phorward
Copy link
Member Author

b48b420 implements a different way on this, but still makes the comma optional. This was just a neat idea, but doesn't comply with the rest of Tokays syntax and also raises confusions.

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

No branches or pull requests

1 participant