Function: pfuture--decompose-fn-form

pfuture--decompose-fn-form is a macro defined in pfuture.el.

Signature

(pfuture--decompose-fn-form FN &rest ARGS)

Documentation

Expands into the correct call form for FN and ARGS.

FN may either be a (sharp) quoted function, and unquoted function or an sexp.

Source Code

;; Defined in ~/.emacs.d/elpa/pfuture-20220913.1401/pfuture.el
(defmacro pfuture--decompose-fn-form (fn &rest args)
  "Expands into the correct call form for FN and ARGS.
FN may either be a (sharp) quoted function, and unquoted function or an sexp."
  (declare (indent 1))
  (pcase fn
    (`(function ,fn)
     `(,fn ,@args))
    (`(quote ,fn)
     `(,fn ,@args))
    ((or `(,_ . ,_) `(,_))
     fn)
    ((pred null)
     (ignore fn))
    (fn
     `(funcall ,fn ,@args))))