5 declaration-information
11 (declaim (ftype (sfunction
12 (symbol &optional (or null sb-kernel:lexenv))
13 (values (member nil :special :lexical :symbol-macro :constant)
16 variable-information))
17 (defun variable-information (var &optional env)
18 (let* ((*lexenv* (or env (sb-kernel:make-null-lexenv)))
19 (info (lexenv-find var vars)))
21 (sb-c::leaf (let ((type (sb-kernel:type-specifier
22 (sb-kernel:type-intersection
23 (sb-c::leaf-type info)
24 (or (lexenv-find info type-restrictions)
25 sb-kernel:*universal-type*)))))
29 `((ignore . ,(sb-c::lambda-var-ignorep info))
33 `((type . ,type)) ; XXX ignore
37 `((type . ,type)) ; XXX ignore
39 (cons (values :symbol-macro t
40 nil ; FIXME: also in the compiler
42 (null (values (ecase (info :variable :kind var)
45 (:macro :symbol-macro)
49 (type . ,(sb-kernel:type-specifier ; XXX local type
50 (info :variable :type var)))))))))
52 (defun parse-macro (name lambda-list body
54 (declare (ignore env))
55 (with-unique-names (whole environment)
56 (multiple-value-bind (body decls)
57 (sb-kernel:parse-defmacro lambda-list whole body name
59 :environment environment)
60 `(lambda (,whole ,environment)
64 (defun enclose (lambda-expression
67 (sb-c::make-restricted-lexenv env)
68 (sb-kernel:make-null-lexenv))))
69 (compile-in-lexenv nil lambda-expression env)))