Skip to content

Instantly share code, notes, and snippets.

@kindlychung
Created May 12, 2015 12:47
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 kindlychung/10bd14ecc4349f818c30 to your computer and use it in GitHub Desktop.
Save kindlychung/10bd14ecc4349f818c30 to your computer and use it in GitHub Desktop.
(defmacro aupdate-in [a i f & args]
`(do
(aset ~a ~i (~f (aget ~a ~i) ~@args))
a))
(let [a (long-array [1 2 3 4])]
(pprint (vec (aupdate-in a 2 * 3))))
@kindlychung
Copy link
Author

CompilerException java.lang.RuntimeException: No such var: cina.fn-browser/a, compiling:(/Users/kaiyin/personal_config_bin_files/workspace/cina/src/cina/fn_browser.clj:20:16)

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