Re: :gen-class method signature help

2017-08-07 Thread Sir Robert Burbridge
Success! I've included the final solution here for completeness and community contribution. 1. Thanks, Didier-- your last bit got me on the right path. 2. Thanks, Gregg-- it turns out gen-class does recognize that syntax, if quoted, like so: #^{:static true} [score ["[Ljava.l

Re: :gen-class method signature help

2017-08-07 Thread Didier
Arrays in Clojure are different to Lists, and its probably why when you pass arrays to the score fn, that things don't work 100%. If you can coerce those arrays to a java list it would probably work. You can do that in js, but if that doesn't work or seem easy, you could have your -score wrappe

Re: :gen-class method signature help

2017-08-07 Thread Gregg Reynolds
Never mind, I see you tried that in your original code. ;) On Mon, Aug 7, 2017 at 1:03 PM, Gregg Reynolds wrote: > > > On Mon, Aug 7, 2017 at 10:56 AM, Sir Robert Burbridge > wrote: > >> Didier, thanks for the reply! >> >> >>1. I created a wrapper function like this: (defn -score [data >>

Re: :gen-class method signature help

2017-08-07 Thread Gregg Reynolds
On Mon, Aug 7, 2017 at 10:56 AM, Sir Robert Burbridge wrote: > Didier, thanks for the reply! > > >1. I created a wrapper function like this: (defn -score [data >context] (score data context)) >2. I tried your suggestion but got an error. Here's the current state: > > The JS calling

Re: :gen-class method signature help

2017-08-07 Thread Sir Robert Burbridge
Didier, thanks for the reply! 1. I created a wrapper function like this: (defn -score [data context] (score data context)) 2. I tried your suggestion but got an error. Here's the current state: The JS calling code: function genFixture () { return new Array(12).fill(parseFloat(Math