3 ms·
The Common Lisp version he has is pretty poor; I think this is more idiomatic, and is two lines as well: (defun build (list1 list2) (loop for x in
by wtbob 11y ago
The Common Lisp version he has is pretty poor; I think this is more idiomatic, and is two lines as well:
(defun build (list1 list2)
(loop for x in list1 append (loop for y in list2 collect `(,x ,y))))
or:
(defun build (list1 list2)
(mapcan (lambda (x) (mapcar (lambda (y) `(,x ,y)) list2)) list1))
Still more verbose, of course, but not at all bad.