On Sun, Dec 29, 2013 at 4:11 PM, Timothy Baldridge <tbaldri...@gmail.com>wrote:
> Not mentioned in Cedric's post are two other important things: > > Protocols can be extended to existing types. > These are important for the Expression Problem, but not for the OP's query as originally stated, which simply asked for the contrast with overloading. That contrast is dynamic vs. static dispatch. As for C++ being able to solve the Expression Problem and thus being "equally powerful", well, both languages are also Turing complete. But which will generally let you be more expressive, with less ceremony and verbosity? Which has templates and macros that are unhygienic and a bugbear to work with, and which has macros that are very safe and clean? (Incidentally, it was template woes that eventually broke the camel's back for me with C++. I gave up on C++ when I found that one of the most widely-used free software C++ compilers would give duplicate definition errors at link time if the same template was used with the same parameters in two separate compilation units, and the developers had *no sane fix or workaround* or even an ETA on a fix...imagine if importing java.util.Map and using Map<String,Integer> in Foo.java and also importing java.util.Map and using Map<String,Integer> in Bar.java and then running something using both classes Foo and Bar had resulted in linkage errors instead of two classes coexisting at runtime that both used Map<String,Integer>s. Java 1.5 would have never gotten off the ground! But this C++ compiler -- and yes, it was then-current gcc -- would do exactly that if you #included hash_map and used hash_map<const char *,int,some_string_hashfn,strcmp> in two compilation units.) -- -- 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/groups/opt_out.