Call by value

From Wiki @ Karl Jones dot com
Jump to: navigation, search

In computer programming,Call by value (also referred to as pass by value) an evaluation strategy in which the argument expression is evaluated, and the resulting value is bound to the corresponding variable in the function (frequently by copying the value into a new memory region).

Description

If the function or procedure is able to assign values to its parameters, only its local copy is assigned—that is, anything passed into a function call is unchanged in the caller's scope when the function returns.

Call by value is not a single evaluation strategy, but rather the family of evaluation strategies in which a function's argument is evaluated before being passed to the function. While many programming languages (such as Common Lisp, Eiffel and Java) that use call by value evaluate function arguments left-to-right, some evaluate functions and their arguments right-to-left, and others (such as Scheme, OCaml and C) leave the order unspecified.

See also

External links