Funarg Problem

In computer science, the funarg problem refers to the difficulty in implementing first-class functions (functions as first-class objects) in implementations with stack-based memory allocation.

The difficulty only arises if the body of a nested function refers directly (i.e., not via argument passing) to identifiers defined in the environment in which the function is defined, but not in the environment of the function call. To summarize the discussion below, two standard resolutions are to either forbid such references or to create closures.

There are two subtly different versions of the funarg problem. The upwards funarg problem arises from returning (or otherwise transmitting "upwards") a function from a function call. The downwards funarg problem arises from passing a function as a parameter to another function call.

Read more about Funarg Problem:  Upwards Funarg Problem, Downwards Funarg Problem, Practical Implications

Famous quotes containing the word problem:

    From cradle to grave this problem of running order through chaos, direction through space, discipline through freedom, unity through multiplicity, has always been, and must always be, the task of education, as it is the moral of religion, philosophy, science, art, politics and economy; but a boy’s will is his life, and he dies when it is broken, as the colt dies in harness, taking a new nature in becoming tame.
    Henry Brooks Adams (1838–1918)