Function: internal--thread-argument

internal--thread-argument is a macro defined in subr-x.el.gz.

Signature

(internal--thread-argument FIRST? &rest FORMS)

Documentation

Internal implementation for thread-first and thread-last.

When Argument FIRST? is non-nil argument is threaded first, else last. FORMS are the expressions to be threaded.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/subr-x.el.gz
(defmacro internal--thread-argument (first? &rest forms)
  "Internal implementation for `thread-first' and `thread-last'.
When Argument FIRST? is non-nil argument is threaded first, else
last.  FORMS are the expressions to be threaded."
  (pcase forms
    (`(,x (,f . ,args) . ,rest)
     `(internal--thread-argument
       ,first? ,(if first? `(,f ,x ,@args) `(,f ,@args ,x)) ,@rest))
    (`(,x ,f . ,rest) `(internal--thread-argument ,first? (,f ,x) ,@rest))
    (_ (car forms))))