17 Jul
2012
17 Jul
'12
2:19 a.m.
Hi folks, I was wondering how we can conveniently pass longs, bytes into normal Java functions/constructors, for example, (jnew "java.lang.Byte" 23) ==> Java exception 'java.lang.NoSuchMethodException: Byte(java.lang.Integer)'. [Condition of type JAVA-EXCEPTION] Here only constructor available is for "byte" inputs. It's a pain to have to use this every time we use a byte, long, or similar: (jnew (jconstructor "java.lang.Byte" "byte") 23) #<java.lang.Byte 23 {3A9300BF}> Relatedly/alternatively, is there a way convenient to coerce values to a certain type, forcing 23 above (default int/Integer) to be a byte or long? Yong