nash icon indicating copy to clipboard operation
nash copied to clipboard

language: add maps

Open katcipis opened this issue 8 years ago • 0 comments

It would be great to finally have some way to structure data that is not solely positional (lists).

The idea is to build something with a syntax very close to Go/Python:, initializing:

a = {
    "a" : 1,
    "b" : "c",
    "c" : [ 1, 2, 3 ],
    "d" : {
    }
}

Accessing:

a["b"]

Assigning/adding:

a["b"] = 5

We can leverage maps to implement packages adding some syntatic sugar for acess/assigment:

a.value = 5
echo $a.value

Calling a function from a map would be clean, as:

a.dostuff()

katcipis avatar Apr 01 '17 00:04 katcipis