Map literals

What is the syntax for a map literal?
For instance in python, it is possible to do
my_list = [0, 1, 2, 10]

What is the equivalent statement in ash using maps?
 

heeheehee

Developer
Staff member
Code:
$ints[1,2,3]

The result *looks* like a boolean[int] map. This isn't actually a map literal, since order and duplicates are preserved, and it's immutable. But it's as close as we can get.
 
Is there any way to get this to work with other types? I got it to work with booleans, but it doesn't seem to work with $item or any of the other KoL types.
 

heeheehee

Developer
Staff member
You should be using plural datatypes, e.g. $items[seal-clubbing club, seal tooth]

Also note that if you do something like $items[], it'll actually yield all items.

See here for more info.

edit: erm, wait, are you referring to the value returned by said map, as opposed to its keys? No way to do that; not supported by ASH.
 
Top