On Mon, May 21, 2012 at 5:39 AM, Mark Engelberg <mark.engelb...@gmail.com>wrote:
> On Mon, May 21, 2012 at 1:53 AM, nicolas.o...@gmail.com < > nicolas.o...@gmail.com> wrote: > >> I just have. This is a nice work. There is a lot of repetitions though. >> > > Thanks Nicolas for putting together these examples. This is exactly what > I've been talking about. Whenever someone talks about the issue of > developing reusable partial implementation of protocols, the answer is > always, "You can do that easily in Clojure by merging mappings." But in > practice, I haven't seen many examples of anyone actually doing that. If > people who are writing big systems (e.g., Clojurescript) aren't actually > providing mergeable mappings, then writing new implementations for these > protocols becomes a big copy-paste hackjob. > Have you looked at systems that use protocols extensively? The two I'm familiar with, core.logic and ClojureScript, do not constitute a "copy-paste hackjob". In fact I'd be surprised if the amount of copy-paste in either isn't less than 1% of the entire code base and a 1% where the redundancy is innocuous (IHash, IPrintable). > We need to figure out a way to make reusable partial implementations the > norm. > Shared functions work today. None of this to suggest that there aren't more "convenient" ways to share defaults. But I think the benefit of having type definitions that can be understood with an entirely local reading without having to search a type hierarchy or consider "defaults" should not be underestimated. 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