COMP 302 Lecture 12: Feb 2 (W5,L3): Closures and Objects

38 views8 pages

Document Summary

Today: higher order objects and objects as closures. We want to have something that flips values. Until we introduced the notion of mutation, there was a strict rule: every time you evaluate an expression, it will always give you the same value. Input let mutable a = 0 let flip0 () = (a unit . No actual value is fed, no actual value is returned, just a dummy. The variable a is global and completely unprotected.

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