First-class function

This is an old revision of this page, as edited by LittleDan (talk | contribs) at 15:49, 18 April 2005 (C *does* support first class functions; they dont' need to be created "dynamically"). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
function object.

In computer science, a first class function is a programming language construct that allows function objects to be treated in many respects like ordinary data objects. In particular, a first class function can be created during the execution of a program, stored in a data structure, passed as an argument to another function, and, in some programming languages, modified using the data processing facilities of the language.

Support for first class functions is widely considered to be a required feature for functional programming languages. Lisp, Scheme, ML, and Haskell are examples of functional programming languages that support first class functions.

Most modern programming languages support functions defined statically at compile time. C additionally supports function pointers, which can be stored in data structures and passed as arguments to other functions.

See also