3

我们在这里讨论 oo 功能混合,但我想知道有多少语言实际上符合这个名称。Scala、Clojure、F#?还有吗?

每个答案获得一种这样的语言会很棒,并稍微解释一下,为什么您认为它是OO功能混合体。

4

6 回答 6

3

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

于 2010-07-02T08:44:25.483 回答
3

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.

于 2010-07-02T08:45:58.163 回答
2

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.

于 2010-07-02T08:51:54.470 回答
2

Nemerle(不幸的是)不是广为人知的功能-OO 混合设计,旨在运行在 .NET 平台上。Nemerle 的有趣之处在于它的多功能宏系统强大的类型推断

于 2010-07-02T09:43:28.273 回答
1

O'Haskell,它基本上是一个带有面向对象功能的 Haskell。

于 2010-07-02T09:48:53.403 回答
0

Racket是一种具有类系统的函数式语言(Scheme 的一种方言)。类系统支持可覆盖的方法(如 Java、C#)和可扩展的方法(超类的方法首先获得控制;它决定是否/何时调用子类的方法以及如何处理结果)。类系统还支持高阶合约。

实际上,Lisp 和 Schemes 有很多对象系统。Common Lisp 的 CLOS 可能是最著名和最有影响力的。

于 2011-09-11T07:30:25.230 回答