Function: ad-retrieve-args-form
ad-retrieve-args-form is a byte-compiled function defined in
advice.el.gz.
Signature
(ad-retrieve-args-form ARGLIST)
Documentation
Generate a form which evaluates into names/values/types of ARGLIST.
When the form gets evaluated within a function with that argument list
it will result in a list with one entry for each argument, where the
first element of each entry is the name of the argument, the second
element is its actual current value, and the third element is either
required, optional or rest depending on the type of the argument.
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/advice.el.gz
(defun ad-retrieve-args-form (arglist)
"Generate a form which evaluates into names/values/types of ARGLIST.
When the form gets evaluated within a function with that argument list
it will result in a list with one entry for each argument, where the
first element of each entry is the name of the argument, the second
element is its actual current value, and the third element is either
`required', `optional' or `rest' depending on the type of the argument."
(let* ((parsed-arglist (ad-parse-arglist arglist))
(rest (nth 2 parsed-arglist)))
`(list
,@(mapcar (lambda (req)
`(list ',req ,req 'required))
(nth 0 parsed-arglist))
,@(mapcar (lambda (opt)
`(list ',opt ,opt 'optional))
(nth 1 parsed-arglist))
,@(if rest (list `(list ',rest ,rest 'rest))))))