Lexical vs dynamic scoping in terms of SICP's Environment Model of Evaluation

前端 未结 1 1662
遇见更好的自我
遇见更好的自我 2021-02-20 05:12

In Section 3.2.2 of SICP the execution of the following piece of code

(define (square x)
  (* x x))
(define (sum-of-squares x y)
  (+ (square x) (square y)))
(d         


        
1条回答
  •  生来不讨喜
    2021-02-20 05:38

    The answer to both questions is yes. That chapter of SICP is explaining lexical scope without actually using the term. Changing the evaluation mechanism as you describe would create a dynamically-scoped model.

    0 讨论(0)
提交回复
热议问题