CSE 130 Lecture Notes - Lecture 3: Syntactic Sugar, Evaluation Strategy, Function Application

46 views3 pages

Document Summary

Control flow, operators, classes, etc w/ syntactic sugar: ( () => { Use lambda calculus to extend to different features. Evaluation strategy - only evaluate if it needs to be used. Semantics - the meaning of the program and how we interpret it. Expressions : e ::= x | x. e | e 1 e 2. Same a s x => e in js. Assume 2 and + are encoded by functions. In js: x => 2 + x ( x. (2+x)) 5. In js: (x => 2+x) (5) x = > { return 2 + x; } ( f. (f 3)) ( x. (x + 1)) In js: ( f => f(3) ) ( x => x+1 ) In js: f => (x => f ( (x))) //argument f that returns a function which takes in x as an argument and. Js: ((f => (x => f (f (x)))) (x => x+1)) (4)

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