REDUCE

15.4 Using LET Inside Procedures

By using let instead of an assignment in the procedure body it is possible to bypass the call-by-value protection. If X is a formal parameter or local variable of the procedure (i.e. is in the heading or in a local declaration), and let is used instead of := to make an assignment to x, e.g.

        let x = 123;

then it is the variable that is the value of x that is changed. This effect also occurs with local variables defined in a block. If the value of x is not a variable, but a more general expression, then it is that expression that is used on the left-hand side of the let statement. For example, if x had the value p*q, it is as if let p*q = 123 had been executed.


Hosted by Download REDUCE Powered by MathJax