danilopedraza / komodo

The Komodo programming language code repository
https://komodo-lang.org/
GNU General Public License v3.0
6 stars 0 forks source link

List/Set syntax #58

Closed danilopedraza closed 1 month ago

danilopedraza commented 1 month ago

Recently I decided to add dictionaries with the following syntax:

{a: 1, b: 2}

There is a problem: the colon character is already being used for list and set comprehensions, so it will be more tricky to decide what the user wants. My solution to that problem is changing the syntax for sets and lists. Now it should be like this:

[a for a in [1, 2]]
{x for x [1, 3] if x % 2 = 0}
danilopedraza commented 1 month ago

The last example is a new functionality that I thought of at the moment, but I don't plan to add it right now.

danilopedraza commented 1 month ago

This is done.