It seems that guarding the protocol declarations inside of a defonce does the job nicely, although it is a big fugly. It's not too bad a trade-off though, because we rarely, if ever, want to change a protocol definition live. My main concern is that it wasn't obvious what was breaking Overtone during reloads, and it took some real trial and error discovery to figure that it was the protocol declarations. Perhaps Phil is right, and they're not the best choice for the job - perhaps multimethods might be a better fit for our needs.
I think that at least the documentation could be improved to warn people that defprotocol and namespace reloading don't play well together. This thread will already act as a start in this area :-) David, it's cool that ClojureScript doesn't suffer from this issue though! Sam --- http://sam.aaron.name On 19 Jun 2012, at 16:35, David Nolen wrote: > On Tue, Jun 19, 2012 at 10:49 AM, Phil Hagelberg <p...@hagelb.org> wrote: > Protocols necessarily make some unfortunate dynamicity trade-offs in the name > of self-hosting. If you value interactive development over execution > efficiency perhaps they are not the right choice. > > -Phil > > Depending on what Clojure implementation you are using of course. > ClojureScript doesn't have this problem ;) > > Given my understanding of how protocols are currently implemented on Clojure > JVM (partially backed by very static Java interfaces), I don't think you can > achieve what you want. Perhaps JVM invokedynamic can help one day? > > David > > -- > 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 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