Re: ClojureScript ^:export defprotocol

2014-06-19 Thread Mike Fikes
I found the solution to the original question I had posed: Is there a way to indicate the protocol names should be preserved? > (Analogous to the way ^:export can be used on function definitions.) You simply need to place the meta directly in the method signature forms, as illustrated here: (

Re: ClojureScript ^:export defprotocol

2014-06-18 Thread Mike Fikes
That's cool. I see no reason why Clojure / ClojureScript's “reach” can't extend significantly into iOS. On Wednesday, June 18, 2014 3:58:18 PM UTC-4, Gary Trakhman wrote: > > I was just telling a local ios dev there's like five guys using clojure + > objective-c. To me it's impressive. To them,

Re: ClojureScript ^:export defprotocol

2014-06-18 Thread Gary Trakhman
I was just telling a local ios dev there's like five guys using clojure + objective-c. To me it's impressive. To them, well, I don't know what they'd think :-). On Wednesday, June 18, 2014, Mike Fikes wrote: > Right, Gary, > > Initially I simply wrote exported functions. > > The motivation for e

Re: ClojureScript ^:export defprotocol

2014-06-18 Thread Mike Fikes
Right, Gary, Initially I simply wrote exported functions. The motivation for experimenting with protocols is so that I can write a ClojureScript protocol that mimics, say the iOS UITableViewDataSource Objective-C @protocol. Then, with that in place, I can write ClojureScript reifications of th

Re: ClojureScript ^:export defprotocol

2014-06-18 Thread Mike Fikes
Even without JIT available in JavaScriptCore, I have been unable to notice a difference in the on-device performance of the “view controller” code I have been writing when turning on :advanced. Thanks for the suggestion, I'll go with :simple and :static-fns. The reified protocol instance works

Re: ClojureScript ^:export defprotocol

2014-06-18 Thread Gary Trakhman
'any problem.. fixed.. by another layer of indirection' You could also just make exportable functions that call the protocols, keeping them more as impl-details, core.cljs does this, and you gain things like varargs (hmm, do protocol-varargs work on cljs? nope: http://dev.clojure.org/jira/browse/C

Re: ClojureScript ^:export defprotocol

2014-06-18 Thread David Nolen
On iOS is advanced compilation really necessary? :simple + :static-fns true should suffice. On Wednesday, June 18, 2014, Mike Fikes wrote: > Is there a way to indicate that a (ClojureScript) protocol is intended to > be used from the host? > > Details: > > I can define a protocol and an implemen

ClojureScript ^:export defprotocol

2014-06-18 Thread Mike Fikes
Is there a way to indicate that a (ClojureScript) protocol is intended to be used from the host? Details: I can define a protocol and an implementation of it in ClojureScript using defprotocol and reify. I can also successfully call methods on reified instances returned to the host (Obj-C em