Data update

This commit is contained in:
Ingy döt Net 2025-02-27 18:35:13 -05:00
parent 8e4e15fa56
commit 72eb4943cb
1853 changed files with 35514 additions and 9441 deletions

View file

@ -1,3 +1,11 @@
(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))))
(defun hash-from-two-arrays (seq1 seq2)
(let ((hash (make-hash-table :test 'equal))
(list1 (if (listp seq1) seq1 (append seq1 nil)))
(list2 (if (listp seq2) seq2 (append seq2 nil))))
(while (and list1 list2)
(puthash (car list1) (car list2) hash)
(setq list1 (cdr list1)
list2 (cdr list2)))
hash))
(hash-from-two-arrays (list 'a 'b 'c) [1 2 3])

View file

@ -1,5 +1,7 @@
val new = foldfrom(
fn h, key, value:more(h, {key: value}),
{:}, fw/a b c d/, [1, 2, 3, 4],
val new = fold(
fw/a b c d/, [1, 2, 3, 4],
by=fn(h, key, value) { more h, {key: value} },
init={:},
)
writeln new

View file

@ -0,0 +1,3 @@
A ← {"carl" "randy" "sam"}
B ← {"robinson" "michaels" "wooley"}
map A B