COMPSCI 61A Lecture Notes - Lecture 3: Docstring, George Boole, Eval

26 views7 pages
zogo39484755 and 6 others unlocked
COMPSCI 61A Full Course Notes
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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents