Hash from two arrays: Difference between revisions

(Added Yabasic)
Line 1,303:
=={{header|langur}}==
=== the easy way ===
<syntaxhighlight lang="langur">writeln(hash wfw/a b c d/, [1, 2, 3, 4])</syntaxhighlight>
</syntaxhighlight>
 
Note that wfw/a b c d/ is a semantic convenience equivalent to ["a", "b", "c", "d"].
 
=== a longer way ===
Using the append operator would silently overwrite hash values for matching keys, but the more() function will not.
<syntaxhighlight lang="langur">val .new = foldfrom(
ffn(.hash, .key, .value) more .hash, h{.key: .value},
h{}, wfw/a b c d/, [1, 2, 3, 4],
)
 
885

edits