java

2019-07-22T21:35:04.001900Z

Is there a good way to write out a (is it called "parameterized"?) java type like [Lmy.java.Thing; so that it can be read later? Is the only way to do it to write it as a string then read it in a macro that turns it into a symbol first?

alexmiller 2019-07-22T21:38:16.002400Z

that type is not a parameterized java type, it's an array of Thing

alexmiller 2019-07-22T21:38:31.002600Z

user=> (class (make-array String 10))
[Ljava.lang.String;

alexmiller 2019-07-22T21:39:03.003Z

it may help to start with what you're actually trying to accomplish

2019-07-22T21:46:55.003300Z

Touché, thanks!

alexmiller 2019-07-22T21:53:17.005800Z

wasn't try to be snarky, was actually asking :)

alexmiller 2019-07-22T21:53:50.006500Z

sorry if that didn't come across well

2019-07-22T21:54:09.006700Z

I have a big data structure which is the result of analyzing some java classes, for the purpose of wrapping a java api "programatically". It needs the type info of some things to properly wrap them. I have things working for the most part when generate all the data via reflection at the start of my program but I started looking into spitting out the data at edn so that I can just load that instead. (I was hung up a little earlier on an actual issue working with parameterized types so I think that was in my head when I saw these arrays printed)

2019-07-22T21:54:37.007300Z

Nah it's all good 🙂

2019-07-22T21:59:11.008700Z

so i think I can actually just handle the arrays in the same I do the parameterized type, but using getComponentType instead of .getParameterizedType and then only writing the component type and an indicator that it's to be contained in an array