I tried to assign a data type to a var and then instantiate it using
the var, but it doesn't seem to work:

user=> (defrecord X [])
user.X

user=> (X.)
#:user.X{}

user=> X
user.X

user=> (def hey X)
#'user/hey

user=> (hey.)
java.lang.IllegalArgumentException: Unable to resolve classname: hey
(NO_SOURCE_FILE:59)

user=> (new X)
#:user.X{}

user=> (new hey)
java.lang.IllegalArgumentException: Unable to resolve classname: hey
(NO_SOURCE_FILE:61)

user=> (apply new hey)
java.lang.Exception: Unable to resolve symbol: new in this context
(NO_SOURCE_FILE:62)

Can anybody help me understand how to accomplish this when using the
var? This will give me a generic way to instantiate the type when I
know the parameters.

Regards,
Shantanu

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to