FPr (programming language)

FPr
Stable release 0.11
Operating system Windows
Type Function-level Programming Language Interpreter
Website fpstefan.de

FPr (Function-level Programming right-associative) is a programming language that is an implementation of an FP-System. FP was invented by John Backus and described in his Turing Award lecture.[1] FPr features the list-techniques of Lisp and some techniques of object-oriented programming especially the use of the infix notation. FPr offers an alternative for the usage of local variables.

Example

len == lenrec ° id, (0 &), nil
lenrec == (nilp ° 1) -> 2 ; lenrec ° (tail ° 1), (2 + 1 &), nil

Defines the function len for counting the elements of a list-object and the recursive function lenrec which is doing the loop.

len : (list :: aa bb cc dd ee)

Applicates the function len to a list-object with 5 elements.

Quicksort in FPr

"At the Beginning for the Automation"
qsort ° text1

"Definition of Quicksort for List Processing"
qsort==isnil->id;
	((qsort°3)++1,qsort°4)
	°((not°isnil°2)->*1,(tail°2),(1>1°2)->(((1°2),3),4,nil);3,((1°2),4),nil)
	°1,tail,(nil as _1),(nil as _1),nil

"The Argument for this Example"
text1==(list :: Advantages of FP systems . The main reason FP systems are considerably simpler than
either conventional languages or lambda-calculus-based languages is that they use only the most
elementary fixed naming system {naming a function in a definition} with a simple fixed rule of
substituting a function for its name . Thus they avoid the complexities both of the naming systems of
conventional languages and of the substitution rules of the lambda calculus . FP systems permit the
definition of different naming systems {...} for various purposes . These need not be complex, since
many programs can do without them completely . Most importantly, they treat names as functions that can
be combined with other functions without special treatment .)&

See also

References

External links

This article is issued from Wikipedia - version of the Monday, December 07, 2015. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.