Task

Using two Arrays of equal length, create a Hash object
where the elements from one array (the keys) are linked
to the elements of the other (the values)



Related task

   Associative arrays/Creation


 
use Structure;
 
bundle Default {
  class HashOfTwo {
    function : Main(args : System.String[]) ~ Nil {
      keys := ["1", "2", "3"];
      vals := ["a", "b", "c"];
      hash := StringHash->New();
      each(i : vals) {
        hash->Insert(keys[i], vals[i]->As(Base));
      };
    }
  }
}
 