The Full Wiki

More info on Erlang Programming/Function Objects

Erlang Programming/Function Objects: Wikis


Note: Many of our articles have direct quotes from sources you can cite, within the Wikipedia article! This article doesn't yet, but we're working on it! See more info or our list of citable articles.


Up to date as of January 23, 2010

From Wikibooks, the open-content textbooks collection

< Erlang Programming

Function Objects

Function objects can be named or unnamed, or stored in a variable. Function objects can be like lambda expressions. Lambda expression in Erlang are created with the keyword "fun". Lambda expressions are unnamed functions that can be stored in variables. Please consider the following:

Sample Erlang command line code:

Mod = fun(X,Y) -> X rem Y end.

Generic behaviors often use function objects to become specialized. A generic server can be dynamically given a function object to allow it to become a particular type of server or service provider.


Got something to say? Make a comment.
Your name
Your email address