class Hash

  # Creates a new hash from two arrays --a keys array and
  # a values array.
  #
  #   Hash.zipnew(["a","b","c"], [1,2,3])
  #     #=> { "a"=>1, "b"=>2, "c"=>3 }
  #
  def self.zipnew(keys,values) # or some better name
    h = {}
    keys.size.times{ |i| h[ keys[i] ] = values[i] }
    h
  end

end

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
=begin test

  require 'test/unit'

  class TC01 < Test::Unit::TestCase

    def test_zipnew
      a = [1,2,3]
      b = [4,5,6]
      assert_equal( {1=>4,2=>5,3=>6}, Hash.zipnew(a,b) )
    end

  end

=end
