nash
nash copied to clipboard
language: add maps
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()