Talk:Function object

From Wikipedia, the free encyclopedia

The Generator link (on the Python section) references to "Electric Generator", may be there must be a dissambiguate page.

Isn't the CL section a little ... fanboyish? Don't get me wrong, I love closures as much as the next FP freak, but saying they are the 'true' form of function objects seems a little absurd. 202.180.83.6 05:29, 15 December 2005 (UTC)

Contents

[edit] C++ section too verbose?

I think the subsection on C++ functors is getting a bit out of hand. It is becoming much less like an encyclopedia article and more like a text book (a confusing one at that). Also the latest changes made on 22 Jan 2005 are written in a rather informal grammatical style and need some editing.

May I suggest that either the C/C++ section be trimmed back, or a different article be created specifically to discuss all the detailed nuances and advanced techniques of C++ functors and leave this article to just give the flavor as a comparison to a few other major languages. -- Dmeranda 04:32, 28 Jan 2005 (UTC)

I was the one who added the CFunctor C++ stuff. I will agree that it does not flow as well as the rest of the article. I want to also post it on freedevs.net, we are trying to create some tutorials.
If you guys want to change it or delete it that is fine with me. A different article would be nice, but I do not know what it should be called. -- Trailcode
I'm not exactly a Wikipedia expert, but I think in keeping with the Wikipedia goals, information about the subject should be kept here, but perhaps more tutorial-like information is best left someplace else. Perhaps if your tutorial site is better, you can link to it (assuming the content is free and not likely to be seen as spamming Wikipedia). You might walso want to check out Wikibooks (http://wikibooks.org/) and see if there's a place for content there.
However I'm sure some of your new content is useful and valuable and should not be lost. And since C++ tends to have rather complex and many varied forms of functors (moreso than most languages), it warrants having it's own advanced-usage page so as not to overwhelm this article. Maybe a page named Functors in C Plus Plus? (see also Wikipedia:Naming conventions (technical_restrictions))- Dmeranda 17:53, 31 Jan 2005 (UTC)


I posted that CFunctors tutorial at www.freedevs.net and got some constructive criticism. I removed the stuff I added but it is still on the net. When I have time I will make it better. In the previous functors tutorial there is something like "other functors", I will put a link there when it is done. -- Trailcode

[edit] Merger?

The proposed merger with Closure (Computer Science) is absurd and insulting. Wouter Lievens 10:17, 8 Jun 2005 (UTC)

We are having a discussion of this at Talk:Closure (computer science). -- Taku 11:43, Jun 8, 2005 (UTC)
Allright, sorry :-) Wouter Lievens 12:36, 8 Jun 2005 (UTC)
No, no, I just wanted to consolidate the discussion. -- Taku 22:58, Jun 8, 2005 (UTC)
OK, so as per the discussion you two had on the other page and the Wouter's persuasive arguments, can we remove the merger tag here?--Hooperbloob 06:36, 25 July 2005 (UTC)
Sorry I forgot to remove the tag. -- Taku 23:23, July 25, 2005 (UTC)

[edit] Python generators

The mention of Python generators as being a special case of a functor does deserve mention here, and so I'm reverting the deletion of material made by User:Eurleif Agreed, he is correct in that it is just a functor, but in this language it does have special prominance. There is in fact an entire article about it here (see Generator_(computer_science)), as well as specific language syntax and support (see [PEP 255]), including the name "Generator" itself. So I see no reason to remove this mention of generators. It is not incorrect, and it's a small amount of text. If you feel the text is somehow not worthy of this article, perhaps you'd instead like to add some additional description instead. [BTW, if you are removing entire paragraphs in the future, please don't mark your edit as being minor—thanks.] Dmeranda 17:49, 22 August 2005 (UTC)

Hey, I deleted it again, before reading this discussion. Sorry. I deleted it because I don't see it as relevant. Generators are not really related to __call__(). The purpose of this article isn't to list all the Python objects that can be used with function-call syntax (types, slot wrappers, bound methods...). Jorend 20:17, 10 January 2006 (UTC)

[edit] Functor out of favor

At least in the C++ community, the word "functor" has fallen out of favor somewhat because of the clash with the distinct meaning from mathematics. I think this article should use "function object" as a rule and only mention "functor." "Function object" is, after all, the title of the entry

[edit] Numbers in Python

>>> dir(1)
['__abs__', '__add__', '__and__', '__class__', '__cmp__', '__coerce__', (...)]
>>> (1).__add__(3)
4
>>> isinstance(1, object)
True
>>> issubclass(int, object)
True

Enough said. --Sam Pointon 17:05, 6 June 2006 (UTC)