Created
March 18, 2011 10:55
-
-
Save sunilnandihalli/875893 to your computer and use it in GitHub Desktop.
using volatile-mutable in deftype ...
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
(definterface IPoint | |
(getX []) | |
(setX [v])) | |
(deftype Point [^{:volatile-mutable true} x] | |
IPoint | |
(getX [this] x) | |
(setX [this v] (set! (.x this) v))) | |
(def sss (Point. 10)) | |
(.setX sss 20) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment