Re: Getting rid of boxing and reflection when working with characters

2014-10-21 Thread Gary Verhaegen
On Saturday, 4 October 2014, Fluid Dynamics wrote: > I still think I have optimization opportunities in this code, but still > have not received the requested information about profiling in > counterclockwise. > Search for VisualVM. It is specific to neither Counterclockwise nor Clojure. -- Y

Re: Getting rid of boxing and reflection when working with characters

2014-10-04 Thread Fluid Dynamics
On Friday, October 3, 2014 2:45:09 PM UTC-4, adrian...@mail.yu.edu wrote: > > You can also call (.getNumericValue (.charAt "foo" 0)) to get the int the > static Character isX methods expect. >> >> >>> Boxing, boxing, boxing! Apparently it did not occur to the Clojure developers that tight loop

Re: Getting rid of boxing and reflection when working with characters

2014-10-03 Thread adrian . medina
You can also call (.getNumericValue (.charAt "foo" 0)) to get the int the static Character isX methods expect. On Friday, October 3, 2014 2:38:58 PM UTC-4, adrian...@mail.yu.edu wrote: > > charAt returns a char, not a primitive int, which is why you are getting > the "ClassCastException java.la

Re: Getting rid of boxing and reflection when working with characters

2014-10-03 Thread adrian . medina
charAt returns a char, not a primitive int, which is why you are getting the "ClassCastException java.lang.Character cannot be cast to java.lang.Number" exception. The long coercion function will inline to `(. clojure.lang.RT (longCast ~x)), and since that that is a static method which lacks a

Getting rid of boxing and reflection when working with characters

2014-10-03 Thread Fluid Dynamics
OK, can someone tell me what the hell is going on here? (defn alphanumeric? "Given a character, returns true iff the character is alphanumeric. Accented letters and other things that pass Character/isAlphabetic are all counted as alphanumeric." [^long c] (or (Character/isDigit c) (Char