Content deleted Content added
TakuyaMurata (talk | contribs) |
|||
Line 89:
::If the example is bad, then it needs to be rewritten. It doesn't mean the article has to be merged with an unrelated random other article. You might as well merge it with [[Lambda Calculus]]. Also, the example isn't a bad one, and it doesn't even closely resemble a function object, as it is expressed in ML, '''which isn't object-oriented'''. If in your view closures and function objects are the same thing, you need to get your concepts straight. [[User:Wlievens|Wouter Lievens]] 10:15, 8 Jun 2005 (UTC)
:My concepts of function objects and closure are those put in each article.
:a '''closure''' is an abstraction representing a [[function (programming)|function]], plus the lexical environment (see static scoping) in which the function was created, and its application to arguments.
:A '''function object''', often called a '''functor''', is a [[computer programming]] construct allowing an [[object (computer science)|object]] to be invoked or called as if it were an ordinary [[function (programming)|function]], usually with the same syntax.
The definition of a closure awafully resembles that of a function object in Java, for instance. Take this:
interface Function {
public int map (int y);
}
final int step = 2;
new Function () {
public int map (int y) { return y + step; }
}
I am not suggesting the example in the article is bad. It shows what is a closure. And I am still waiting to see what is a difference. I can't find this anywhere yet. Finally, a function object is certainly not limited to object-oriented languages. I think it's an old concept originated in functional programming. Maybe I am missing something. -- [[User:TakuyaMurata|Taku]] 11:41, Jun 8, 2005 (UTC)
|