Create dict: Difference between revisions

212 bytes added ,  2 years ago
add K3 version
(uniqueness of keys)
(add K3 version)
Line 1:
{{primitive|.x<br>x!y}}
 
The '''create dict''' primitive, a.k.a. '''map''', takesconverts twoits listsargument(s) of equal length and makesto a [[dictionary]] using the left argument as keys, and the right argument as the values.
 
==== K3 ====
Takes a an array of pairs and converts it to a dictionary.
<pre>
.((`a;10);(`b;20))
.((`a;10;)
(`b;20;))
</pre>
{{works in|Kona}}
 
==== K6+ ====
 
Takes two lists of equal length and makes a [[dictionary]] using the left argument as keys, and the right argument as the values.
Uniqueness of the keys is not enforced.