NPL programming language
   HOME

TheInfoList



OR:

NPL is a
functional programming language In computer science, functional programming is a programming paradigm where programs are constructed by applying and composing functions. It is a declarative programming paradigm in which function definitions are trees of expressions that ...
with
pattern matching In computer science, pattern matching is the act of checking a given sequence of tokens for the presence of the constituents of some pattern. In contrast to pattern recognition, the match usually has to be exact: "either it will or will not be ...
designed by Rod Burstall and John Darlington in 1977. The language allows certain sets and logic constructs to appear on the right hand side of definitions, e.g. setofeven(X) <= <:x: x in X & even(x) :> The NPL interpreter evaluates the list of generators from left to right so conditions can mention any bound variables that occur to their left. These were known as set comprehensions. NPL eventually evolved into Hope but lost set comprehensions, which made a reappearance in the form of
list comprehension A list comprehension is a syntactic construct available in some programming languages for creating a list based on existing lists. It follows the form of the mathematical ''set-builder notation'' (''set comprehension'') as distinct from the use of ...
s in later functional languages.


References

* John Darlington (1977). "Program Transformation and Synthesis: Present Capabilities". Research Report No. 77/43, Dept. of Computing and Control, Imperial College of Science and Technology, London. Academic programming languages Functional languages History of computing in the United Kingdom {{compu-lang-stub