COMPSCI 61A Lecture Notes - Lecture 3: Docstring, George Boole, Eval
zogo39484755 and 6 others unlocked
22
COMPSCI 61A Full Course Notes
Verified Note
22 documents
Document Summary
Go to lab that matches your discussion. Different environments in a single environment diagram. Name bound to the function in the current frame. Function (value of operator called on arguments), values of operator called on arguments (values of operands) Body is executed in that new environment. Global frame is the last frame in the environment. Every expression is evaluated in the context of an environment. Name evaluates to the value bound to that name in the earliest frame of the current environment in which that name is found. When we evalute mul(x,x) for the second time, need to look up mul and x, Find x in f2, look up mul in the global frame, bound to multiply function. Names have different meanings in different environments. When we eval square(4), we eval expression the call expression in the global frame, because it"s not indented, it means we evaluate it in the global frame.