Skip to content

Instantly share code, notes, and snippets.

@kindlychung
Created May 12, 2015 12:29
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/dc979b308a4bbb800415 to your computer and use it in GitHub Desktop.
Save kindlychung/dc979b308a4bbb800415 to your computer and use it in GitHub Desktop.
(use 'clojure.pprint)
(defmacro aupdate-in [a i f & args]
`(aget ~a ~i (~f (aget ~a ~i) ~@args)))
(pprint
(macroexpand-1
(aupdate-in (int-array [1 2 3]) 1 * 5)))
@kindlychung
Copy link
Author

CompilerException java.lang.IllegalArgumentException: Argument is not an array, compiling:(/Users/kaiyin/personal_config_bin_files/workspace/cina/src/cina/fn_browser.clj:41:42)

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