I'm trying to find a way to create associative arrays, such as dictionaries in Python:
dictionary = {"key1": value1, "key2": value2}
How can I implement it in Vala? or if there is no other solution that would be more practical.
Thank you.
I'm trying to find a way to create associative arrays, such as dictionaries in Python:
dictionary = {"key1": value1, "key2": value2}
How can I implement it in Vala? or if there is no other solution that would be more practical.
Thank you.
GLib.HashTable
is probably the closest:
var diccionario = new GLib.HastTable<string,string>();
diccionario["clave1"] = "valor1";
diccionario["clave2"] = "valor2";