Re: given a java.lang.Class, accessing a static field of the associated class

2010-05-06 Thread Alan Dipert
Hello, Since maps are functions of their keys, I think you can get away with something like: (def unbox {Byte Byte/TYPE Integer Integer/TYPE}) (unbox Integer) ;int Regarding your let/defn, I think in general if you have functions that depend on compile-time constants it's idioma

Re: given a java.lang.Class, accessing a static field of the associated class

2010-05-06 Thread B Smith-Mannschott
On Thu, May 6, 2010 at 15:22, Stuart Halloway wrote: > Reflection is slow, there are less than ten of these, and the possible set > ain't gonna change. > > I would write a function that looks them up from a map. Yea, I considered that too. The only reason I didn't was because of a misguided desi

Re: given a java.lang.Class, accessing a static field of the associated class

2010-05-06 Thread Stuart Halloway
Reflection is slow, there are less than ten of these, and the possible set ain't gonna change. I would write a function that looks them up from a map. Stu This post originally started as a question, but I've since found a solution. I thought I'd post it anyway, perhaps someone knows of a nic

given a java.lang.Class, accessing a static field of the associated class

2010-05-06 Thread B Smith-Mannschott
This post originally started as a question, but I've since found a solution. I thought I'd post it anyway, perhaps someone knows of a nicer approach. I'd like a function which maps from a boxed type as represented by a java.lang.Class (i.e. Integer, Boolean, Float) to the associated unboxed type.