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

39 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+
$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