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

List comprehensions #66

Open
darrylabbate opened this issue Dec 30, 2022 · 0 comments
Open

List comprehensions #66

darrylabbate opened this issue Dec 30, 2022 · 0 comments
Labels
experimental Purely experimental ideas (for now) feature New feature or request language Language features/requests

Comments

@darrylabbate
Copy link
Member

darrylabbate commented Dec 30, 2022

There are any number of ways to design a list comprehension syntax, so not really concerned with those details at the moment. Though I'd want it to be delimited by braces ([]) like many other languages.

The only tricky constraint is to be able to support list comprehensions as well as vanilla "list" literals in the form [0,1,2,...]. Python, as an example, doesn't allow the two syntaxes to coincide in the same literal. That's a reasonable restriction, though it doesn't really help wrt the compiler disambiguating a list comprehension from a vanilla literal. The biggest thing would be a syntax where the "output expression" is the first element (most common style). If the syntax had some other unique token first, it'd be a non-issue.

Ref:

@darrylabbate darrylabbate added feature New feature or request language Language features/requests experimental Purely experimental ideas (for now) labels Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
experimental Purely experimental ideas (for now) feature New feature or request language Language features/requests
Projects
None yet
Development

No branches or pull requests

1 participant