Vote count: 0 I'm reading about lambda calculus. From the end of section 2.1 here http://www.toves.org/books/lambda/: (λx.(λx.λy.x × y) 3 ((λz.x + z) 2)) 1 ⇒ (λx.λy.x × y) 3 ((λz.x + z) 2) where x = 1 ⇒ (λy.x × y) ((λz.x + z) 2) where x = 3 ⇒ x × y where x = 3 and y = (λz.x + z) 2 ⇒ x × y where x = 3 and y = x + z and z = 2 ⇒ x × y where x = 3 and y = 5 and z = 2 ⇒ 15 It says In fact, though, y should attain the value 3 rather than 5 since the first beta-reduction should plug 1 into x's spot in the expression. For this reason, a lazy parameter must preserve the current variable context with each reduction, remembering in this case that x = 3 within the expression λy.x × y but maintaining the...
ادامه مطلب