In pure lambda calculus the order of evaluation of


Order of Evaluation

In pure lambda calculus, the order of evaluation of subexpressions does not effect the value of an expression. The same is true for pure Lisp: if a pure Lisp expres- sion has a value under the ordinary Lisp interpreter, then changing the order of evaluation of subterms cannot produce a different value.

To give aconcrete example, consider the following section of Lisp code:

(define a ( ... ))

(define b ( ... ))... (define f (lambda (x y z) (cons (car x) (cons (car y) (cdr z))))) ... (f e1 e2 e3)

The ordinary evaluation order for the function call (f e1 e2 e3) is to evaluate the arguments e1 e2 e3 from left to right and then pass this list of values to the function f.

Give an example of Lisp expressions e1 e2 e3, possibly by using functions rplaca or rplacd with side effects, so that evaluating expressions from left to right gives a different result from that obtained by evaluating them from right to left. You may ?ll in speci?c declarations for a or b if you like and refer to a or b in your expressions. Explain brie?y, in one or two sentences, why one order of evaluation is different from the other.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: In pure lambda calculus the order of evaluation of
Reference No:- TGS01269920

Expected delivery within 24 Hours