Skip to content

Instantly share code, notes, and snippets.

@cemerick
Created July 27, 2010 23:07
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 cemerick/bab9181cf1f1eda95caf to your computer and use it in GitHub Desktop.
Save cemerick/bab9181cf1f1eda95caf to your computer and use it in GitHub Desktop.
(defmacro apply-ctor
[classname args]
`(~(symbol (str classname \.)) ~@args))
1:44 user=> (defrecord Foo [a b c d])
user.Foo
1:45 user=> (apply-ctor Foo [1 2 3 4])
#:user.Foo{:a 1, :b 2, :c 3, :d 4}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment