Hash from two arrays: Difference between revisions

Added Pike implementation
(Added Pike implementation)
Line 1,451:
(two . 2)
(three . 3)</pre>
 
=={{header|Pike}}==
Any data type can be used as indices (keys) and values.
<lang Pike>
array indices = ({ "a", "b", 42 });
array values = ({ Image.Color(0,0,0), "hello", "world" });
mapping m = mkmapping( indices, values );
write("%O\n", m);
</lang>
{{Out}}
<pre>
([ /* 3 elements */
"a": Image.Color.black,
"b": "hello"
42: "world",
])
</pre>
 
=={{header|Pop11}}==
Anonymous user