FACTOID # 122: If you're Dutch or Swedish, you're among the world's most likely to end up living in a retirement home. If you're Japanese, you'll probably end up living with your children.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

FACTS & STATISTICS    Simple view

  1. Select countries to view: (hold down Control key and click to select several)

     

     

    Compare:

     

     

  1. Select fact or statistic: (* = graphable)

     

     

     

  2. (OPTIONAL) Compare to statistic: (both need to be graphable)

     

     

     

  3. View result as:

     

       
(OR) SEARCH ALL encyclopedia, stats & forums:   

Encyclopedia > FP programming language

FP (short for Function Programming) is a programming language created by John Backus to support the Function-level programming paradigm. This allows for the elimination of named variables. A programming language or computer language is a standardized communication technique for expressing instructions to a computer. ... John Backus (born December 3, 1924) is an American computer scientist, notable as the inventor of the first high-level programming language (FORTRAN), the Backus-Naur form (BNF, the almost universally used notation to define formal language syntax), and the concept of Function-level programming. ... Function-level programming refers to one of the two contrasting programming paradigms identified by John Backus in his work on Programs as mathematical objects, the other being Value-level programming. ...

Contents

Overview

The values that FP programs map into one another comprise a set which is closed under sequence formation: SET may refer to: Secure electronic transaction, a protocol used for credit card processing, Simulated Emergency Test, an Amateur radio training exercise, Society for the Eradication of Television, Stock Exchange of Thailand, a national stock exchange of Thailand, SET Index, an index for Stock Exchange of Thailand This is a... In topology and related branches of mathematics, a closed set is a set whose complement is open. ...

 if x1,...,xn are values, then the sequencex1,...,xn〉 is also a value 

These values can be built from any set of atoms: booleans, integers, reals, characters, etc.:

 boolean : {T, F} integer : {0,1,2,...,∞} character : {'a','b','c',...} symbol : {x,y,...} 

is the undefined value, or bottom. Sequences are bottom-preserving:

x1,...,,...,xn〉 =  

FP programs are functions f that each map a single value x into another:

 f:x represents the value that results from applying the function f to the value x 

Functions are either primitive (i.e., provided with the FP environment) or are built from the primitives by program-forming operations (also called functionals). An example of one such operation is constant, which transforms a value x into the constant-valued function . Functions are strict: In the denotational semantics of programming languages, a function f is said to be strict if . ...

 f: =  

Some functions have a unit value, such as 0 for addition and 1 for multiplication. The functional unit produces such a value when applied to a function f that has one:

 unit + = 0 unit × = 1 unit foo = ⊥ 

Functionals

These are the core functionals of FP:

 constant  where :y = x 
 composition f&#x°g where f&#x°g:x = f:(g:x) 
 construction [f1,...fn] where [f1,...fn]:x = 〈f1:x,...,fn:x
 condition (hf;g) where (hf;g):x = f:x if h:x = T = g:x if h:x = F =  otherwise 
 apply-to-all αf where αf:〈x1,...,xn〉 = 〈f:x1,...,f:xn
 insert-right /f where /f:〈x〉 = x and /f:〈x1,x2,...,xn〉 = f:〈x1,/f:〈x2,...,xn〉〉 and /f:〈 〉 = unit f 
 insert-left f where f:〈x〉 = x and f:〈x1,x2,...,xn〉 = f:〈f:〈x1,...,xn-1〉,xn〉 and f:〈 〉 = unit f 

Equational functions

In addition to being constructed from primitives by functionals, a function may be defined recursively by an equation, the simplest kind being:

 fEf 

where E'f is an expression built from primitives, other defined functions, and the function symbol f itself, using functionals. An expression in a programming language is a combination of values and functions or procedures, interpreted according to the particular rules of precedence and of association for a particular programming language, which computes and then returns another value. ...


An example of a primitive function is the selector function family, denoted by 1,2,... where:

 1:〈x1,...,xn〉 = x1 i:〈x1,...,xn〉 = xi if 0 < i ≤ n = ⊥ otherwise 

See also



 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.