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
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
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
Looking forward to an Overtone API over WebAudio (http://chromium.googlecode.com/svn/trunk/samples/audio/index.html) :)David