Skip to content

Instantly share code, notes, and snippets.

@hiredman
Created February 2, 2019 01:01
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 hiredman/c09669ba90c306f54830864fab228363 to your computer and use it in GitHub Desktop.
Save hiredman/c09669ba90c306f54830864fab228363 to your computer and use it in GitHub Desktop.
reflection boxing
user=>
(as-> clojure.lang.RT %
(.getDeclaredField % "checkSpecAsserts")
(doto % (.setAccessible true))
(.get % nil)
(doto % prn)
(if % :a :b))
false
:a
user=>
@hiredman
Copy link
Author

hiredman commented Feb 2, 2019

also fun
(as-> java.lang.Boolean % (.getDeclaredField % "value") (doto % (.setAccessible true)) (.get % clojure.lang.RT/F) (doto % prn) (if % :a :b))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment