From 2f3acc39fbb7a3b7fad30fca48d1d94d04e488e2 Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Sat, 27 Oct 2012 23:13:24 +0200 Subject: [PATCH] Fixed SYS:FUNCTION-LAMBDA-LIST so that it works with macros and special operators --- src/lsp/top.lsp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/lsp/top.lsp b/src/lsp/top.lsp index f5f01e376..bbd167559 100644 --- a/src/lsp/top.lsp +++ b/src/lsp/top.lsp @@ -826,14 +826,19 @@ Use special code 0 to cancel this operation.") (push '&allow-other-keys output)))) (nreverse output))) +(defun lambda-list-from-annotations (name) + (declare (si::c-local)) + (let ((args (ext:get-annotation name :lambda-list nil))) + (values args (and args t)))) + (defun function-lambda-list (function) (cond ((symbolp function) - (if (or (not (fboundp function)) - (special-operator-p function) - (macro-function function)) - (values nil nil) - (function-lambda-list (fdefinition function)))) + (cond ((or (special-operator-p function) + (macro-function function)) + (lambda-list-from-annotations function)) + (t + (function-lambda-list (fdefinition function))))) ((typep function 'generic-function) (values (clos:generic-function-lambda-list function) t)) ;; Use the lambda list from the function definition, if available, @@ -857,9 +862,7 @@ Use special code 0 to cancel this operation.") ;; If it's a compiled function of ECL itself, reconstruct the ;; lambda-list from its documentation string. (t - (let* ((name (compiled-function-name function)) - (args (ext:get-annotation name :lambda-list nil))) - (values args (and args t)))))) + (lambda-list-from-annotations (compiled-function-name function))))) #-ecl-min (defun decode-env-elt (env ndx)