1 ;;;; the representation of a lexical environment
3 ;;;; This software is part of the SBCL system. See the README file for
6 ;;;; This software is derived from the CMU CL system, which was
7 ;;;; written at Carnegie Mellon University and released into the
8 ;;;; public domain. The software is in the public domain and is
9 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
10 ;;;; files for more information.
14 #!-sb-fluid (declaim (inline internal-make-lexenv)) ; only called in one place
16 ;;; The LEXENV represents the lexical environment used for IR1 conversion.
17 ;;; (This is also what shows up as an ENVIRONMENT value in macroexpansion.)
18 #!-sb-fluid (declaim (inline internal-make-lexenv)) ; only called in one place
20 ;; FIXME: should probably be called MAKE-EMPTY-LEXENV or
22 (:constructor make-null-lexenv ())
23 (:constructor internal-make-lexenv
24 (functions variables blocks tags type-restrictions
26 interface-cookie options)))
27 ;; Alist (name . what), where What is either a Functional (a local function),
28 ;; a DEFINED-FUNCTION, representing an INLINE/NOTINLINE declaration, or
29 ;; a list (MACRO . <function>) (a local macro, with the specifier
30 ;; expander.) Note that Name may be a (SETF <name>) function.
31 (functions nil :type list)
32 ;; An alist translating variable names to Leaf structures. A special binding
33 ;; is indicated by a :Special Global-Var leaf. Each special binding within
34 ;; the code gets a distinct leaf structure, as does the current "global"
35 ;; value on entry to the code compiled. (locally (special ...)) is handled
36 ;; by adding the most recent special binding to the front of the list.
38 ;; If the CDR is (MACRO . <exp>), then <exp> is the expansion of a symbol
40 (variables nil :type list)
41 ;; Blocks and Tags are alists from block and go-tag names to 2-lists of the
42 ;; form (<entry> <continuation>), where <continuation> is the continuation to
43 ;; exit to, and <entry> is the corresponding Entry node.
44 (blocks nil :type list)
46 ;; An alist (Thing . CType) which is used to keep track of "pervasive" type
47 ;; declarations. When Thing is a leaf, this is for type declarations that
48 ;; pertain to the type in a syntactic extent which does not correspond to a
49 ;; binding of the affected name. When Thing is a continuation, this is used
50 ;; to track the innermost THE type declaration.
51 (type-restrictions nil :type list)
52 ;; The lexically enclosing lambda, if any.
54 ;; FIXME: This should be :TYPE (OR CLAMBDA NULL), but it was too hard
55 ;; to get CLAMBDA defined in time for the cross-compiler.
57 ;; The lexically enclosing cleanup, or NIL if none enclosing within Lambda.
59 ;; FIXME: This should be :TYPE (OR CLEANUP NULL), but it was too hard
60 ;; to get CLEANUP defined in time for the cross-compiler.
62 ;; The representation of the current OPTIMIZE policy.
63 (cookie *default-cookie* :type cookie)
64 ;; The policy that takes effect in XEPs and related syntax parsing functions.
65 ;; Slots in this cookie may be null to indicate that the normal value in
67 (interface-cookie *default-interface-cookie* :type cookie)
68 ;; an alist of miscellaneous options that are associated with the lexical
70 (options nil :type list))