X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-cltl2%2Fenv.lisp;h=905e9b6f33a910956a5020d6b7db6d99739e85f6;hb=0e03a9ac950b78d776c4869c809e202d9e929f39;hp=379de12ef8fb8f19975f6707e5f86fa9e9828f51;hpb=835768a81dad03b7eb94c2058e234413ba066396;p=sbcl.git diff --git a/contrib/sb-cltl2/env.lisp b/contrib/sb-cltl2/env.lisp index 379de12..905e9b6 100644 --- a/contrib/sb-cltl2/env.lisp +++ b/contrib/sb-cltl2/env.lisp @@ -52,6 +52,24 @@ alist of declarations that apply to the apparent binding of VAR." (type . ,(type-specifier ; XXX local type (info :variable :type var))))))))) +(declaim (ftype (sfunction (symbol &optional (or null lexenv)) t) + declaration-information)) +(defun declaration-information (declaration-name &optional env) + (let ((env (or env (make-null-lexenv)))) + (case declaration-name + (optimize + (let ((policy (sb-c::lexenv-policy env))) + (collect ((res)) + (dolist (name sb-c::*policy-qualities*) + (res (list name (cdr (assoc name policy))))) + (loop for (name . nil) in sb-c::*policy-dependent-qualities* + do (res (list name (sb-c::policy-quality policy name)))) + (res)))) + (sb-ext:muffle-conditions + (car (rassoc 'muffle-warning + (sb-c::lexenv-handled-conditions env)))) + (t (error "Unsupported declaration ~S." declaration-name))))) + (defun parse-macro (name lambda-list body &optional env) (declare (ignore env)) (with-unique-names (whole environment)