List comprehensions #66
Labels
experimental
Purely experimental ideas (for now)
feature
New feature or request
language
Language features/requests
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:
The text was updated successfully, but these errors were encountered: