Skip to content

Instantly share code, notes, and snippets.

@eschulte
Created January 22, 2010 15:51
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 eschulte/283864 to your computer and use it in GitHub Desktop.
Save eschulte/283864 to your computer and use it in GitHub Desktop.
;; how to use an imperative library (bcel) in clojure
(defn list-expand [asm]
;; I need a mutable InstructionList
(with-local-vars [lst (new InstructionList)]
;; Append is an InstructionList method on which alters the calling
;; InstructionList through side effects
(map #(.append (var-get lst) %) asm)
(var-get lst)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment