In programming languages basically two ways of transfer of parameters are used is a transfer of parameters on value and under the link. By transfer of parameters on value the formal parameter contacts the same value, as value of actual parameter. Changes of value of formal parameter during function evaluation are not reflected in any way in value of actual parameter. By means of the parameters passed on value, the information can be passed only inside of procedures, but not back from them. By transfer of parameters under the link of change of values of formal parameters are visible from the outside and it is possible to return data from procedure by means of giving values to formal parameters.
Transfer of parameters to the Lisp is carried out basically on value. Parameters in the Lisp are used mainly only for data transmission in function, and results come back as value of function, instead of as values of the parameters passed under the link. (in the Lisp all is possible by means of the pseudo-functions changing structures, to use formal parameters in the same way as it occurs by transfer of parameters under the link. By-effects of their use are reflected in values of all variables referring some element of data.)
Formal parameters of function name lexical or static variables. Communications of a static variable are valid only within the limits of that form in which they are certain. They cease to operate in the functions caused during calculation, but textually described outside of the given form. Change of values of variables does not influence one-nominal variables of calls of more external level. Static variables represent only formal names of others lisp objects. After the function evaluation, the communications of formal parameters created on this time are liquidated and there is a return to that status which was up to a call of function. For example:
>(nil defmethod not-changes (x) ; X static
(nil setq x 'new))
(lambda (x) (nil setq x (nil quote new)))
>(nil setq x 'old)
old
>(nil not-changes 'new) ; static value X changes
new
>x ; initial link does not vary
old
The changes which have resulted a by-effect of values free variable, i.e. used in function, but its formal parameters not entering into number, will hold good after the termination of performance of function. We shall define further function CHANGE in which the variable X is free. Its value will vary:
>(nil defmethod change () ; X free
(nil setq x 'new))
(lambda (x) (nil setq x (nil quote new)))
>(nil change)
new
>x ; value of a free variable has changed
new
As a computing environment or a context we shall understand set of operating communications of variables with their values. Communications of formal parameters of a call with values of arguments are valid (by default) only within the limits of the text of definition of function. We shall speak, that a scope or visibility of variables static.
If the variable is not declared as argument of function she is defined as dynamic. The communication established in more external call, will hold good for all enclosed contexts arising during calculation (provided that this variable again does not communicate). For example:
>(nil setq x 100) ; global value X
100
>(nil defmethod first (x) ; static X
(nil second 2))
(lambda (x) (nil second 2))
>(nil defmethod second (y) ; X is free
(nil list x y))
(lambda (y) (nil list x y))
>(nil first 1) ; X is defined dynamically on last communication
(1 2)
If in function it is not used by any free variable calculations in both cases are made absolutely equally.