#separator:tab
#html:true
#tags column:3
In an environment-diagram problem, what is the complete graded artifact?	Every frame with its parent arrow, every binding, and each call's return value.<br>One wrong arrow cascades through every later lookup — completeness is the point.<br><small>Source: DNA §2.1 — what a Frame Autopsy demands</small>	claritycs61a topic-01 dna-sec2
Python calls a function — what two things does the new frame record immediately?	The parameters, each bound to its argument's value in order, and the parent pointer — set to the frame where the function was DEFINED.<br><small>Source: DNA §5.1 — frame creation</small>	claritycs61a topic-01 dna-sec5
A name is evaluated inside a function body — where does lookup search, in order?	The current frame, then each parent frame outward, then the global frame, then built-ins — stopping at the first frame that holds the name.<br><small>Source: DNA §5.1 — the lookup order</small>	claritycs61a topic-01 dna-sec5
What exactly does a function value's parent pointer point to?	The frame where that function was defined — for a lambda, the frame where the lambda was evaluated; for a def, the frame where the def statement ran.<br><small>Source: DNA §5.1 — the parent-pointer rule</small>	claritycs61a topic-01 dna-sec5
A def statement executes inside a frame — what binding does it create?	The def'd name is bound in the current frame to a function whose parent is that same frame — the def itself creates no frame.<br><small>Source: DNA §5.1 — how def binds</small>	claritycs61a topic-01 dna-sec5
Does evaluating a lambda expression create a frame?	No — it evaluates to a function value (parameters, body, parent). A frame appears only when that function is called.<br><small>Source: DNA §2.1 — lambdas in the diagram</small>	claritycs61a topic-01 dna-sec2
A function is called from a different frame than the one it was defined in — which frames can its body's lookups reach?	Only its defining environment, via the parent pointer — never the caller's frames. Parents follow definition, not the call site.<br><small>Source: DNA §5.1 — lexical scoping</small>	claritycs61a topic-01 dna-sec5
A name exists in both an enclosing frame and the global frame — which binding wins?	The nearest one along the parent chain — lookup moves outward from the local frame and stops at the first hit.<br><small>Source: DNA §5.1 — the shadowing rule</small>	claritycs61a topic-01 dna-sec5
An assignment rebinds a name the frame already binds — what changes in the diagram?	The existing row's value is overwritten — one row per name per frame. Every later lookup through that frame sees the new value.<br><small>Source: DNA §4.1 — the rebinding mechanic</small>	claritycs61a topic-01 dna-sec4
A lambda is defined; a name it references is reassigned; only then is the lambda called. What does its body see?	The new binding.<br><b>The rebinding trap</b>: names resolve at look-up time, not at definition time — always resolve at call time.<br><small>Source: DNA §4.1 — the rebinding trap</small>	claritycs61a topic-01 dna-sec4
f(g) versus f(g()) — what is the diagram-level difference?	f(g) passes the function object itself — no call, no frame.<br>f(g()) calls g first: draw g's frame, and its return value becomes f's argument.<br><small>Source: DNA §2.1 — function value versus call</small>	claritycs61a topic-01 dna-sec2
The same function is called twice in one run — how many frames?	Two — every call gets its own frame with its own parameter bindings; the calls share nothing except ancestors.<br><small>Source: DNA §2.1 — one frame per call</small>	claritycs61a topic-01 dna-sec2
A lookup consults "the environment" — what is that, concretely?	The chain of frames reachable by following parent pointers from the current frame — the frames a lookup consults, local first, ending at global.<br><small>Source: DNA §5.1 — the environment definition</small>	claritycs61a topic-01 dna-sec5
In a call expression f(a, b), what is evaluated and in what order?	The operator first, then each operand left to right — either may spawn its own frame — then the resulting function is applied to the resulting arguments in a new frame.<br><small>Source: DNA §2.1 — evaluation order</small>	claritycs61a topic-01 dna-sec2
Where does a finished call's return value appear in the diagram?	At the call site — recorded as the return value of the call expression in the calling frame; the callee's frame then stops being consulted.<br><small>Source: DNA §2.1 — return values in the diagram</small>	claritycs61a topic-01 dna-sec2
In what order do bindings appear inside a single frame?	Execution order: parameters at call time, then each assignment or def as the body runs. A binding whose line has not executed does not exist yet.<br><small>Source: DNA §2.1 — binding timing</small>	claritycs61a topic-01 dna-sec2
The diagram is drawn but you suspect a reassignment was mistimed — what cross-check catches it?	Re-resolve every name at its use site, walking the parent chain as it exists at that moment.<br>Rebinding errors come from resolving at definition time instead.<br><small>Source: DNA §4.1 — the rebinding cross-check</small>	claritycs61a topic-01 dna-sec4
make_adder returns an inner function, and the call that created it has finished — why do the inner function's lookups still work?	Its parent pointer still names that finished frame — a returned function keeps its defining environment alive. That captured chain is the closure.<br><small>Source: DNA §5.1 — closures</small>	claritycs61a topic-01 dna-sec5
What distinguishes the global frame from every function's frame?	Global has no parent and holds the top-level bindings; a function frame's parent is its defining frame. Lookup ends at global (built-ins sit after it).<br><small>Source: DNA §5.1 — global versus local</small>	claritycs61a topic-01 dna-sec5
