Function: -cut

-cut is a macro defined in dash.el.

Signature

(-cut &rest PARAMS)

Documentation

Take n-ary function and n arguments and specialize some of them.

Arguments denoted by <> will be left unspecialized.

See SRFI-26 for detailed description.

View in manual

Source Code

;; Defined in ~/.emacs.d/elpa/dash-20260221.1346/dash.el
(defmacro -cut (&rest params)
  "Take n-ary function and n arguments and specialize some of them.
Arguments denoted by <> will be left unspecialized.

See SRFI-26 for detailed description."
  (declare (debug (&optional sexp &rest &or "<>" form)))
  (let* ((i 0)
         (args (--keep (when (eq it '<>)
                         (setq i (1+ i))
                         (make-symbol (format "D%d" i)))
                       params)))
    `(lambda ,args
       ,(let ((body (--map (if (eq it '<>) (pop args) it) params)))
          (if (eq (car params) '<>)
              (cons #'funcall body)
            body)))))