Hash from two arrays: Difference between revisions
Content added Content deleted
(→{{header|Vlang}}: Rename "Vlang" in "V (Vlang)") |
(Add Emacs Lisp) |
||
Line 876: | Line 876: | ||
iex(3)> Enum.zip(keys, values) |> Enum.into(Map.new) |
iex(3)> Enum.zip(keys, values) |> Enum.into(Map.new) |
||
%{one: 1, three: 3, two: 2}</syntaxhighlight> |
%{one: 1, three: 3, two: 2}</syntaxhighlight> |
||
=={{header|Emacs Lisp}}== |
|||
<syntaxhighlight lang="lisp"> |
|||
(let ((keys ["a" "b" "c"]) |
|||
(values [1 2 3])) |
|||
(apply 'vector (cl-loop for i across keys for j across values collect (vector i j))) |
|||
) |
|||
</syntaxhighlight> |
|||
=={{header|Erlang}}== |
=={{header|Erlang}}== |