-
Notifications
You must be signed in to change notification settings - Fork 1
Dict
Johannes Zottele edited this page Sep 19, 2022
·
2 revisions
Dicts are a generic datastructure and with that an exception as Moose doesn't allow you to define custom generic Classes.
Returns the number of key-value pairs.
Converts the dictionary to a list where each item is a tuple with the key and value from the dictionary.
Gets the item with the provided key.
If the key doesn't exist, it will return nil.
There is syntactic sugar for this function:
dict = {"flo": true, "lisa": false}
println(dict["lisa"])Updates the provided key with the provided value.
There is syntactic sugar for this function:
dict = {"flo": true, "lisa": false}
dict["luis"] = false