Dynamic and Lexical variables in Common Lisp

前端 未结 5 1516
予麋鹿
予麋鹿 2020-12-07 16:25

I am reading the book \'Practical Common Lisp\' by Peter Seibel.

In Chapter 6, "Variables" sections "Lexical Variables and Closures" and "Dyn

5条回答
  •  萌比男神i
    2020-12-07 17:29

    You can tell your Lisp to bind local variables dynamically, too:

    (let ((dyn 5))
      (declare (special dyn))
      ... ;; DYN has dynamic scope for the duration of the body
      )
    

提交回复
热议问题