Re: Strange problem when adding type to a var defined by a macro.

2010-01-10 Thread Nicolas Buduroi
> So I think the source of the exception is clear, but have you found a > solution to your original problem? Maybe if you expand on that someone > can describe a good technique. I'm using clojure-contrib's ns-utils/ns-vars and find-namespaces/find- namespaces-on-classpath to discover namespaces a

Re: Strange problem when adding type to a var defined by a macro.

2010-01-09 Thread Timothy Pratley
2010/1/10 Nicolas Buduroi : > That was it, thanks a lot. Ah great. My understanding is that type meta data should go on the object not the var, but that integers for example do not support meta data as they are java objects. Only things like vectors and hash maps do. So you can not set an integer

Re: Strange problem when adding type to a var defined by a macro.

2010-01-09 Thread Nicolas Buduroi
> The macro works fine. The problem is that the REPL tries to print the > result (which is the var you created) and the print multimethod does > not know what to do with your custom type, and the default method > throws an exception. That was it, thanks a lot. - budu -- You received this messag

Re: Strange problem when adding type to a var defined by a macro.

2010-01-09 Thread Timothy Pratley
Hi Nicolas, The macro works fine. The problem is that the REPL tries to print the result (which is the var you created) and the print multimethod does not know what to do with your custom type, and the default method throws an exception. user=> (defbar fuz (+ 1 1)) java.lang.ClassCastException: c

Strange problem when adding type to a var defined by a macro.

2010-01-08 Thread Nicolas Buduroi
Hi, I'm using macros to define special vars (w/ a keyword as type) to retrieve them later with ns-utils/ns-vars and filter them. I don't know if this technique is recommended or if there's some better way to achieve this, but there's something weird happening when we try to evaluate the var defined