On Nov 4, 2008, at 15:20, mb wrote: > And as an effect of not forcing the sorting logic into some class, > one can easily sort the same data in different ways in the FP style. > While implementing an interface Comparable defines *one* way > of sorting, the FP style separates the functions from the data. So > it is eg. easily possible to sort a list of email objects by subject, > author or date, or any combination thereof.
Sorting is indeed an example where the FP approach is superior. But then, it is not representative in size and complexity of a typical program or library. One could easily cite other examples where OOP would be the better choice. My ideal language would support both as much as possible. An example of where Clojure lacks OO features, in my opinion, is your lazy-map library. It provides an additional implementation for an existing interface, which is a typical OO approach, and a very useful one. But although all your code is written Clojure, it looks like a kludge in having to use a feature (genclass) intended for Java compatibility and forcing an unnatural file structure (one file for the methods, one for the code generation, and one for the end-user wrapper) on the implementation. Konrad. --~--~---------~--~----~------------~-------~--~----~ 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 To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---