COMPSCI 61A Lecture Notes - Operand

81 views3 pages
22 Oct 2013
School
Professor
zogo39484755 and 6 others unlocked
COMPSCI 61A Full Course Notes
22
COMPSCI 61A Full Course Notes
Verified Note
22 documents

Document Summary

Expressions - an expression describes a computation and evaluates to a value. Ex: max (1, 2, 3) = 3 min (1, 2, 3) = 1 from operator import add, mil add (2, 3) = 5 mul (4, 5) = 20 mul (add(2, mul(4, 6)), add(3, 5)) --> nest --> 208. Call expression add ( 2 , 3 ) Procedure: eval. operator + operand, apply function that is value of operator subexpression. Evaluating nested expressions mul ( add ( 2 , mul(4, 6), add (3, 5)) mul add ( 2, mul ( 4, 6 ) ) add ( 3, 5 ) = 8 add 2 + 24 (4 * 6) Interpreter: an implementation of the procedure for evaluation. Name - expression refer to some value , can bind multiple names to multiple values def square(x): return mul(x, x) --> also nest functions square (3)

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents