![]() Put_Line ( To_String ( Key_List ( I )) & " => " & To_String ( Hash. Insert ( Key => ( Key_List ( I )), New_Item => ( Element_List ( I ))) end loop for I in Key_List ' range loop Ada. WFA allows workflow designers to use arrays and hash as input for the command when defining a command. Map Key_List : String_Array := ( To_Unbounded_String ( "foo" ), To_Unbounded_String ( "bar" ), To_Unbounded_String ( "val" )) Element_List : String_Array := ( To_Unbounded_String ( "little" ), To_Unbounded_String ( "miss" ), To_Unbounded_String ( "muffet" )) begin for I in Key_List ' range loop Hash. Hash ( To_String ( Key )) end Hash_Func package My_Hash is new _Maps ( Key_Type => Unbounded_String, Element_Type => Unbounded_String, Hash => Hash_Func, Equivalent_Keys => Equivalent_Key ) type String_Array is array ( Positive range ) of Unbounded_String Hash : My_Hash. While the original poster might have wanted an array of strings corresponding to the output of Format-Table, as the supplied attempts and poster's own answer/comments might suggest, the wording of the question heading is more typical of someone wishing to convert the hash table itself into an array of each item's value (converted to String if. With with _Maps with Ada.Text_Io with use procedure Hash_Map_Test is function Equivalent_Key ( Left, Right : Unbounded_String ) return Boolean is begin return Left = Right end Equivalent_Key function Hash_Func ( Key : Unbounded_String ) return Ada. ![]() 112.3 Explicit construction and stuffing.112.2 One-liner, using hash-construct function. ![]() ![]() 112.1 One-liner, using quasiquoted hash syntax.102.3 Using persistent associative arrays. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |