Talk:First-class functions: Difference between revisions

Pointers are not what they point to
(Pointers are not what they point to)
Line 34:
But this technique will only work for a fixed number of functions -- it is basically emulating closures by having a predefined table of closure entry points and data storage.
--[[User:Kevin Reid|Kevin Reid]] 17:54, 24 February 2009 (UTC)
 
:No, pointer to a function is only a first-class pointer. Its "first-classness" alone does not make first-class the thing it points to. The rest of your argumentation is about Turing completeness. Yes, you can create an object that will act similar to a function. A pointer to function is a simplest example of. But this would not make that object a function in language terms.
 
:Some notes to the list. The list rather refers to operations on functional types. Neither of is actually required to make functions first-class. What is required is that a function were a type and there existed objects of this type, with '''some''' operations defined on this type. Whether these operations include any concrete operation beyond "call me," is up to the language. Only "call me" is essential (that makes the object a function). Granted, almost certainly a reasonable implementation will provide operations from the list. --[[User:Dmitry-kazakov|Dmitry-kazakov]] 17:57, 24 February 2009 (UTC)