Content deleted Content added
→Example: reverted anon's changes to the pseudocode (his new version was not "Haskell-inspired", contradicting the text) |
m typo |
||
Line 1:
'''Funarg''' is an abbreviation for "functional argument"; in [[computer science]], the '''funarg problem''' relates to a difficulty in implementing [[function (programming)|function]]s as [[first-class object]]s in [[stack-oriented programming language|stack-based programming language]] implementations.
The difficulty only arises if the body of a 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.<ref>[http://portal.acm.org/citation.cfm?id=1093411 ''The function of FUNCTION in LISP or why the FUNARG problem should be called the environment problem'', by Joel Moses, in: ACM SIGSAM Bulletin 17 (July 1970), pp. 13-27]</ref> To summarize the discussion below, two standard resolutions are:
* forbid such references
* create [[closure (computer science)|closure]]s <ref>[http://portal.acm.org/citation.cfm?id=1093420.1093422 ''A proposed solution to the FUNARG problem'', by Erik Sandewall, in: ACM SIGSAM Bulletin 17 (Jan. 1971), pp. 29-42]</ref>
|