Reputation: 8378
We're discussing oo-functional hybrids here, but I wonder, how many languages actually qualify for this name. Scala, Clojure, F#? Any more?
It'd be great to get one such language per answer, and a little explanation, why you think it is oo-functional hybrid.
Upvotes: 3
Views: 271
Reputation: 10643
Racket is a functional language (a dialect of Scheme) with an class system. The class system supports both overridable methods (like Java, C#) and augmentable methods (the superclass's method gets control first; it decides if/when to call the subclass's method and what to do with the result). The class system also supports higher-order contracts.
Actually, there are many object systems for Lisps and Schemes. CLOS for Common Lisp is probably the most famous and influential.
Upvotes: 0
Reputation: 92016
O'Haskell, which is basically a Haskell with object-oriented features bolted on.
Upvotes: 1
Reputation: 92016
Nemerle is (unfortunately) not so widely known functional-OO hybrid designed to run on the .NET platform. What makes Nemerle interesting is its versatile macro system and powerful type inference.
Upvotes: 2
Reputation: 101555
Smalltalk. I'm sure many will disagree, but I think that the language that not only had first-class functions, but used them so heavily that even the most fundamental constructs (such as if/else and loops) were implemented as function calls taking function-type arguments, deserves the label "functional". Besides, you list Ruby, and most of what it has in FP department, it inherited from Smalltalk.
Upvotes: 2
Reputation: 101555
Objective Caml - as functional as any language from ML family is, but as the name implies, also has a well-developed (and somewhat unique - the only fully structural one I'm aware of) OO system.
Upvotes: 3
Reputation: 101555
Common Lisp. The functional aspects are quite evident, and, on the other hand, CLOS is the mother of all object models.
Upvotes: 3