+(defvar arglist-visited)
+
+;; npak@ispras.ru
+(defun cl-upcase-arg (arg)
+ ;; Changes all non-keyword symbols in `ARG' to symbols
+ ;; with name in upper case.
+ ;; ARG is either symbol or list of symbols or lists
+ (cond ;;((null arg) 'NIL)
+ ((symbolp arg)
+ ;; Do not upcase &optional, &key etc.
+ (if (memq arg lambda-list-keywords) arg
+ (intern (upcase (symbol-name arg)))))
+ ((listp arg)
+ (if (memq arg arglist-visited) (error 'circular-list '(arg)))
+ (cl-push arg arglist-visited)
+ (let ((arg (copy-list arg)) junk)
+ ;; Clean the list
+ (let ((p (last arg))) (if (cdr p) (setcdr p (list '&rest (cdr p)))))
+ (if (setq junk (cadr (memq '&cl-defs arg)))
+ (setq arg (delq '&cl-defs (delq junk arg))))
+ (if (memq '&cl-quote arg)
+ (setq arg (delq '&cl-quote arg)))
+ (mapcar 'cl-upcase-arg arg)))
+ (t arg) ; May be we are in initializer
+ ))
+
+;; npak@ispras.ru
+(defun cl-function-arglist (name arglist)
+ "Returns string with printed representation of arguments list.
+Supports Common Lisp lambda lists."
+ (if (not (or (listp arglist) (symbolp arglist))) "Not available"
+ (setq arglist-visited nil)
+ (condition-case nil
+ (prin1-to-string
+ (cons (if (eq name 'cl-none) 'lambda name)
+ (cond ((null arglist) nil)
+ ((listp arglist) (cl-upcase-arg arglist))
+ ((symbolp arglist)
+ (cl-upcase-arg (list '&rest arglist)))
+ (t (wrong-type-argument 'listp arglist)))))
+ (t "Not available"))))