Re: Type hints inside generated code

2013-12-04 Thread dm3
Sorry for the confusion, type annotations do work in the evaluated code. I just didn't supply enough of them. Although I'm still not sure if they will work in all cases, as per http://stackoverflow.com/questions/11919602/generating-clojure-code-with-type-hints . On Wednesday, 4 December 2013 2

Re: Type hints inside generated code

2013-12-04 Thread dm3
This would work if I knew the type of the function arguments. It doesn't seem to work when type-hinting on the constructor call. On Wednesday, 4 December 2013 22:31:53 UTC+2, James Reeves wrote: > > Try something like: > > (let [x (with-meta (gen-sym) {:tag String}] > (defn foo [~x] ...

Re: Type hints inside generated code

2013-12-04 Thread James Reeves
Try something like: (let [x (with-meta (gen-sym) {:tag String}] (defn foo [~x] ...)) - James On 4 December 2013 19:55, dm3 wrote: > Hello, > > I've been having a little problem when trying to generate java interop > code and avoid reflection warnings. I have to generate a bunch of >

Type hints inside generated code

2013-12-04 Thread dm3
Hello, I've been having a little problem when trying to generate java interop code and avoid reflection warnings. I have to generate a bunch of functions which delegate to java constructors, like this: (defn mk-a [x y z] (A. x y z)) (defn mk-b [x y z] (B. x y z)) The main reason here is to be