Re: [ClojureScript] using apply in a javascript method

2015-07-02 Thread David Nolen
Use the native apply: (.apply (.-setAlign n) n #js [1 2 3]) On Thursday, July 2, 2015, Sonny To son.c...@gmail.com wrote: I have setAlign method on a javascript object called n: (.setAlign n 1 2 3) I want to use apply to make the same call (apply (.setAlign n) [1 2 3]) However that

Re: [ClojureScript] using apply in a javascript method

2015-07-02 Thread David Nolen
memfn won't bind `this`, unless I missed that enhancement :) On Thursday, July 2, 2015, Joe R. Smith j...@uwcreations.com wrote: You want `memfn`. (apply (memfn setAlign) n [1 2 3]) On Jul 2, 2015, at 6:27 AM, Sonny To son.c...@gmail.com javascript:; wrote: I have setAlign method on

Re: [ClojureScript] using apply in a javascript method

2015-07-02 Thread Daniel Kersten
Does *(apply .setAlign n [1 2 3])* work? On Thu, 2 Jul 2015 at 13:23 Sonny To son.c...@gmail.com wrote: I have setAlign method on a javascript object called n: (.setAlign n 1 2 3) I want to use apply to make the same call (apply (.setAlign n) [1 2 3]) However that does work. Any

Re: [ClojureScript] using apply in a javascript method

2015-07-02 Thread Joe R. Smith
You want `memfn`. (apply (memfn setAlign) n [1 2 3]) On Jul 2, 2015, at 6:27 AM, Sonny To son.c...@gmail.com wrote: I have setAlign method on a javascript object called n: (.setAlign n 1 2 3) I want to use apply to make the same call (apply (.setAlign n) [1 2 3]) However that

[ClojureScript] using apply in a javascript method

2015-07-02 Thread Sonny To
I have setAlign method on a javascript object called n: (.setAlign n 1 2 3) I want to use apply to make the same call (apply (.setAlign n) [1 2 3]) However that does work. Any suggestion on how to use apply in this way? The alternative is to write a macro. thanks, Sonny -- Note that posts

Re: [ClojureScript] Re: Startups that bank on Clojure/Script

2015-07-02 Thread Joe R. Smith
Having worked remotely for a couple years now, I can definitely say I’m far more productive. This sums up why: http://heeris.id.au/2013/this-is-why-you-shouldnt-interrupt-a-programmer/ On Jul 2, 2015, at 4:14 PM, Alan Moore kahunamo...@coopsource.org wrote: When constrained by a

[ClojureScript] Re: Startups that bank on Clojure/Script

2015-07-02 Thread Alan Moore
When constrained by a technology choice you may have to give up requiring other developers to be physically proximate. I know managers want the comfort of observing warm bodies in cubes banging on keyboards but it doesn't necessarily translate into higher productivity, I get my best work done