Function: -cons*

-cons* is a byte-compiled function defined in dash.el.

Signature

(-cons* &rest ARGS)

Documentation

Make a new list from the elements of ARGS.

The last 2 elements of ARGS are used as the final cons of the result, so if the final element of ARGS is not a list, the result is a dotted list. With no ARGS, return nil.

View in manual

Source Code

;; Defined in ~/.emacs.d/elpa/dash-20260221.1346/dash.el
(defun -cons* (&rest args)
  "Make a new list from the elements of ARGS.
The last 2 elements of ARGS are used as the final cons of the
result, so if the final element of ARGS is not a list, the result
is a dotted list.  With no ARGS, return nil."
  (declare (side-effect-free t))
  (let* ((len (length args))
         (tail (nthcdr (- len 2) args))
         (last (cdr tail)))
    (if (null last)
        (car args)
      (setcdr tail (car last))
      args)))