Function: ad-parse-arglist
ad-parse-arglist is a byte-compiled function defined in advice.el.gz.
Signature
(ad-parse-arglist ARGLIST)
Documentation
Parse ARGLIST into its required, optional and rest parameters.
A three-element list is returned, where the 1st element is the list of required arguments, the 2nd is the list of optional arguments, and the 3rd is the name of an optional rest parameter (or nil).
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/advice.el.gz
;; @@@ Accessing argument lists:
;; =============================
(defun ad-parse-arglist (arglist)
"Parse ARGLIST into its required, optional and rest parameters.
A three-element list is returned, where the 1st element is the list of
required arguments, the 2nd is the list of optional arguments, and the 3rd
is the name of an optional rest parameter (or nil)."
(let (required optional rest)
(setq rest (car (cdr (memq '&rest arglist))))
(if rest (setq arglist (reverse (cdr (memq '&rest (reverse arglist))))))
(setq optional (cdr (memq '&optional arglist)))
(if optional
(setq required (reverse (cdr (memq '&optional (reverse arglist)))))
(setq required arglist))
(list required optional rest)))