Higher-order programming: Difference between revisions

Content deleted Content added
No edit summary
Added brief motivation for functions that return functions
Line 1:
'''Higher-order programming''' is a style of [[computer programming|programming]] that exploits the theoretical ability to use functions as values; it is usually instantiated with, or borrowed from, models of computation like the [[lambda calculus]] which make heavy use of [[higher-order function]]s.
 
For example, in higher-order programming, one can pass [[Function (programming)|functions]] as arguments to other functions and functions can be the return value of other functions (such as in [[Macro (computer science)|macros]] or for [[Interpreter (computing)|interpretation]]). Functions that generate and return functions on the fly are basically computer programs that create other programs, which can be a very powerful approach. This style of programming is mostly used in [[functional programming]], but it can also be very useful in 'regular' [[object-oriented programming]]. Prominent examples of languages supporting this are [[Perl (programming language)| Perl]], [[Oz (programming language)|Oz]] , [[Python (programming language)|Python]], [[Ruby (programming language)|Ruby]], [[Smalltalk]], [[PHP (programming language)|PHP]], [[ActionScript]], [[JavaScript]], [[Lua (programming language)|Lua]], all the [[Lisp programming language]]s (such as [[Scheme (programming language)|Scheme]]), [[Haskell (programming language)|Haskell]] and [[C (programming language)|C]] (via function pointers).
 
==External links==