'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/CLJS-362 )
On Wed, Jun 18, 2014 at 2:34 PM, David Nolen <dnolen.li...@gmail.com> wrote: > On iOS is advanced compilation really necessary? :simple + :static-fns > true should suffice. > > > On Wednesday, June 18, 2014, Mike Fikes <mikefi...@me.com> 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 implementation of it in ClojureScript >> using defprotocol and reify. >> >> I can also successfully call methods on reified instances returned to the >> host (Obj-C embedding JavaScriptCore on iOS). >> >> The method names are mangled: In addition to the expected and usual >> conversion of hyphens to underscores, the mangled names incorporate dollar >> signs ($) and arity encoding, an example of which is: >> >> my$full$ns$MyProtocol$a_method_defined_in_this_protocol$arity$1 >> >> This can be called, passing this mangled string in as the method name of >> JSValue >> -invokeMethod:withArguments:. >> >> All cool (so long as this mangling is stable from one ClojureScript >> release to the next—but it smells like the mangling could be an >> implementation detail, subject to change). >> >> The killer is if I turn on Google Closure advanced optimizations; these >> mangled names get renamed. >> >> Is there a way to indicate the protocol names should be preserved? >> (Analogous to the way ^:export can be used on function definitions.) >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Clojure" group. >> To post to this group, send email to clojure@googlegroups.com >> Note that posts from new members are moderated - please be patient with >> your first post. >> To unsubscribe from this group, send email to >> clojure+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/clojure?hl=en >> --- >> You received this message because you are subscribed to the Google Groups >> "Clojure" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to clojure+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. >> > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.