Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

Common Lisp. The functional aspects are quite evident, and, on the other hand, CLOS is the mother of all object models.

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.

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.

O'Haskell, which is basically a Haskell with object-oriented features bolted on.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top