Created
July 10, 2018 08:43
-
-
Save y2q-actionman/0990eb4578c0af104022d9fdf176242c to your computer and use it in GitHub Desktop.
clhs 3.1.2.1.1.4 は defvar された変数だと違う
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://www.lispworks.com/documentation/HyperSpec/Body/03_abaad.htm | |
CL-USER> (describe 'x) | |
X is a TENURED SYMBOL. | |
It is unbound. | |
It is globally declared to be a special variable. | |
It is INTERNAL in the COMMON-LISP-USER package. | |
; No value | |
CL-USER> (describe 'y) | |
Y is a NEW SYMBOL. | |
It is unbound. | |
It is INTERNAL in the COMMON-LISP-USER package. | |
; No value | |
CL-USER> (let ((x 1)) ;Binds a special variable X | |
(declare (special x)) | |
(let ((x 2)) ;Binds a lexical variable X | |
(+ x ;Reads a lexical variable X | |
(locally (declare (special x)) | |
x)))) ;Reads a special variable X | |
4 | |
CL-USER> (let ((y 1)) ;Binds a special variable X | |
(declare (special y)) | |
(let ((y 2)) ;Binds a lexical variable X | |
(+ y ;Reads a lexical variable X | |
(locally (declare (special y)) | |
y)))) ;Reads a special variable X | |
3 | |
CL-USER> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment