Function: -table

-table is a byte-compiled function defined in dash.el.

Signature

(-table FN &rest LISTS)

Documentation

Compute outer product of LISTS using function FN.

The function FN should have the same arity as the number of supplied lists.

The outer product is computed by applying fn to all possible combinations created by taking one element from each list in order. The dimension of the result is (length lists).

See also: -table-flat

View in manual

Source Code

;; Defined in ~/.emacs.d/elpa/dash-20260221.1346/dash.el
(defun -table (fn &rest lists)
  "Compute outer product of LISTS using function FN.

The function FN should have the same arity as the number of
supplied lists.

The outer product is computed by applying fn to all possible
combinations created by taking one element from each list in
order.  The dimension of the result is (length lists).

See also: `-table-flat'"
  (declare (important-return-value t))
  (let ((restore-lists (copy-sequence lists))
        (last-list (last lists))
        (re (make-list (length lists) nil)))
    (while (car last-list)
      (let ((item (apply fn (-map 'car lists))))
        (push item (car re))
        (setcar lists (cdar lists)) ;; silence byte compiler
        (dash--table-carry lists restore-lists re)))
    (nreverse (car (last re)))))