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-policy 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
33 ;; binding is indicated by a :SPECIAL GLOBAL-VAR leaf. Each special
34 ;; binding within the code gets a distinct leaf structure, as does
35 ;; the current "global" value on entry to the code compiled.
36 ;; (locally (special ...)) is handled by adding the most recent
37 ;; special binding to the front of the list.
39 ;; If the CDR is (MACRO . <exp>), then <exp> is the expansion of a
41 (variables nil :type list)
42 ;; BLOCKS and TAGS are alists from block and go-tag names to 2-lists
43 ;; of the form (<entry> <continuation>), where <continuation> is the
44 ;; continuation to exit to, and <entry> is the corresponding ENTRY node.
45 (blocks nil :type list)
47 ;; an alist (THING . CTYPE) which is used to keep track of
48 ;; "pervasive" type declarations. When THING is a leaf, this is for
49 ;; type declarations that pertain to the type in a syntactic extent
50 ;; which does not correspond to a binding of the affected name. When
51 ;; Thing is a continuation, this is used to track the innermost THE
53 (type-restrictions nil :type list)
54 ;; the lexically enclosing lambda, if any
56 ;; FIXME: This should be :TYPE (OR CLAMBDA NULL), but it was too hard
57 ;; to get CLAMBDA defined in time for the cross-compiler.
59 ;; the lexically enclosing cleanup, or NIL if none enclosing within Lambda
61 ;; FIXME: This should be :TYPE (OR CLEANUP NULL), but it was too hard
62 ;; to get CLEANUP defined in time for the cross-compiler.
64 ;; the current OPTIMIZE policy
65 (policy *policy* :type policy)
66 ;; the policy that takes effect in XEPs and related syntax parsing
67 ;; functions. Slots in this policy may be null to indicate that the
68 ;; normal value in effect.
69 (interface-policy *interface-policy* :type policy)
70 ;; an alist of miscellaneous options that are associated with the
71 ;; lexical environment
72 (options nil :type list))