JSAbrahams / mamba

🐍 The Mamba programming language, because we care about safety
MIT License
88 stars 4 forks source link

Dictionaries #414

Closed JSAbrahams closed 1 year ago

JSAbrahams commented 1 year ago

Current Issue

High-level description of the feature

Description of potential implementation

Nice grammar would be to use => arrow:

def my_dict := {
    1 => "One",
    2 => "Two",
    3 => "Three"
}

Which would be converted to

y_dict = {
    1: "One",
    2: "Two",
    3: "Three"
}

We also need to add the collection to the language. Need to double check the names of methods of dictionary in Python as well.

JSAbrahams commented 1 year ago

We can't actually parse dictionaries as shown here due to issues with indentation. However, that's a separate issue.