Skip to content

Instantly share code, notes, and snippets.

@sunilnandihalli
Created March 18, 2011 10:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sunilnandihalli/875893 to your computer and use it in GitHub Desktop.
Save sunilnandihalli/875893 to your computer and use it in GitHub Desktop.
using volatile-mutable in deftype ...
(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