Created
July 15, 2010 08:03
-
-
Save t0yv0/476646 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class functional_point y = | |
object | |
val x = y | |
method get_x = x | |
method move d = {< x = x + d >} | |
end | |
#let p = new functional_point 7;; | |
val p : functional_point = <obj> | |
#p#get_x;; | |
- : int = 7 | |
#(p#move 3)#get_x;; | |
- : int = 10 | |
#p#get_x;; | |
- : int = 7 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment