Hash from two arrays: Difference between revisions
Content added Content deleted
m (→{{header|Sidef}}: modified code to work with Sidef 2.10) |
m (→Explicit construction and stuffing: Drop @(do ...)) |
||
Line 1,551: | Line 1,551: | ||
===Explicit construction and stuffing=== |
===Explicit construction and stuffing=== |
||
<lang txrlisp>(defun hash-from-two (vec1 vec2 . hash-args) |
|||
<lang txr>@(do |
|||
( |
(let ((table (hash . hash-args))) |
||
( |
(mapcar (do sethash table) vec1 vec2) |
||
table)) |
|||
table)) |
|||
(prinl (hash-from-two #(a b c) #(1 2 3)))</lang> |
|||
<pre>$ ./txr hash-from-two. |
<pre>$ ./txr hash-from-two.tl |
||
#H(() (c 3) (b 2) (a 1))</pre> |
#H(() (c 3) (b 2) (a 1))</pre> |
||