Does Vala have associative arrays?

0

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.

    
asked by Andy-devnix 25.03.2018 в 01:34
source

1 answer

2

GLib.HashTable is probably the closest:

var diccionario = new GLib.HastTable<string,string>();
diccionario["clave1"] = "valor1";
diccionario["clave2"] = "valor2";
    
answered by 25.03.2018 / 03:50
source