Concept

Procedural parameter

In computing, a procedural parameter is a parameter of a procedure that is itself a procedure. This concept is an extremely powerful and versatile programming tool, because it allows programmers to modify certain steps of a library procedure in arbitrarily complicated ways, without having to understand or modify the code of that procedure. This tool is particularly effective and convenient in languages that support local function definitions, such as Pascal and the modern GNU dialect of C. It is even more so when function closures are available. The same functionality (and more) is provided by objects in object oriented programming languages, but at a significantly higher cost. Procedural parameters are somewhat related to the concepts of first-class function and anonymous function, but is distinct from them. These two concepts have more to do with how functions are defined, rather than how they are used. In most languages that provide this feature, a procedural parameter f of a subroutine P can be called inside the body of P as if it were an ordinary procedure: procedure P(f): return f(6,3) * f(2,1) When calling the subroutine P, one must give it one argument, that must be some previously defined function compatible with the way P uses its parameter f. For example, if we define procedure plus(x, y): return x + y then we may call P (plus), and the result will be plus(6,3) * plus(2,1) = (6 + 3)*(2 + 1) = 27. On the other hand, if we define procedure quot(u, v): return u/v then the call P (quot) will return quot(6,3)quot(2,1) = (6/3)(2/1) = 4. Finally, if we define procedure evil(z) return z + 100 then the call P (evil) will not make much sense, and may be flagged as an error. Some programming languages that have this feature may allow or require a complete type declaration for each procedural parameter f, including the number and type of its arguments, and the type of its result, if any.

About this result
This page is automatically generated and may contain information that is not correct, complete, up-to-date, or relevant to your search query. The same applies to every other page on this website. Please make sure to verify the information with EPFL's official sources.
Related publications (1)

On Counter-Example Complete Verification for Higher-Order Functions

Viktor Kuncak, Etienne Kneuss, Nicolas Charles Yves Voirol

We present a verification procedure for pure higher-order functional Scala programs with parametric types. We show that our procedure is sound for proofs, as well as sound and complete for counter-examples. The procedure reduces the analysis of higher-orde ...
2015
Related concepts (1)
First-class function
In computer science, a programming language is said to have first-class functions if it treats functions as first-class citizens. This means the language supports passing functions as arguments to other functions, returning them as the values from other functions, and assigning them to variables or storing them in data structures. Some programming language theorists require support for anonymous functions (function literals) as well.

Graph Chatbot

Chat with Graph Search

Ask any question about EPFL courses, lectures, exercises, research, news, etc. or try the example questions below.

DISCLAIMER: The Graph Chatbot is not programmed to provide explicit or categorical answers to your questions. Rather, it transforms your questions into API requests that are distributed across the various IT services officially administered by EPFL. Its purpose is solely to collect and recommend relevant references to content that you can explore to help you answer your questions.