Logo

Programming-Idioms

History of Idiom 13 > diff from v42 to v43

Edit summary for version 43 by :
Restored version 41

Version 42

2016-02-18, 16:57:56

Version 43

2016-02-18, 17:20:05

Idiom #13 Iterate over map keys and values

Print each key k with its value x from an associative array mymap

Idiom #13 Iterate over map keys and values

Print each key k with its value x from an associative array mymap

Code
(doseq [k {:a "x" :b "y" :c "z"}] (prn k))
Imports
with Ada.Containers.Indefinite_Hashed_Maps;
with Ada.Strings.Hash;

use Ada.Containers;
Code
for C in My_Map.Iterate loop
   Put_Line ("Key = " & Key (C) & ", Value = " & Element (C));
end loop;
Code
mapM_ print mymap
Code
mapM_ print mymap