Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Made the value evaluation steps at ech step in example 2 bold.

...

Code Block
(define x 5)
(define y 5)
(define z 10)
(local [(define x_0 7) (define y_0 x_0)] (+ x_0 y_0 z))

=>

Code Block

(define x 5)
(define y 5)
(define z 10)
(define x_0 7)
(define y_0 x_0)
(+ x_0 y_0 z)

=>

Code Block
(define x 5)
(define y 5)
(define z 10)
(define x_0 7)
(define y_0 7)
(+ x_0 y_0 z)

...

Code Block
(define x 5)
(define y 5)
(define z 10)
(define x_0 7)
(define y_0 7)
24

Note: { + } is a function of an arbitrary number of numbers in Scheme. Hence (+ 7 7 10) reduces to 24 in a single step. The longer form of this evaluation adds an extra step in lifiting the local.

...