Hash from two arrays: Difference between revisions

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

edits