From 23073e4451f2fd02c441cd6a5ab04e83d7b87ff7 Mon Sep 17 00:00:00 2001 From: "Kaz Saita(raspi5)" Date: Sun, 28 Apr 2024 15:00:24 +0900 Subject: [PATCH] sync notes(auto) --- ...0240428122916 setf setq defvar defparameter の違い.md | 9 +++++++++ ...0428125606 ダイナミックスコープ レキシカルスコープ.md | 1 + 2 files changed, 10 insertions(+) diff --git a/content/20240428122916 setf setq defvar defparameter の違い.md b/content/20240428122916 setf setq defvar defparameter の違い.md index 920f9c0..1d7076e 100644 --- a/content/20240428122916 setf setq defvar defparameter の違い.md +++ b/content/20240428122916 setf setq defvar defparameter の違い.md @@ -68,6 +68,15 @@ d ; => 1 ;; caught 1 WARNING condition (setf e 2); 2回目 ;; 同様のwarningが出る e ; => 2 +;; defconstant強い。letでも変えられない +(let + ((d 2))) +;; Execution of a form compiled with errors. +;; Form: +;; (LET ((D 2))) +;; Compile-time error: +;; COMMON-LISP-USER::D names a defined constant, and cannot be used in LET. +;; [Condition of type SB-INT:COMPILED-PROGRAM-ERROR] ``` ### Refs. diff --git a/content/20240428125606 ダイナミックスコープ レキシカルスコープ.md b/content/20240428125606 ダイナミックスコープ レキシカルスコープ.md index 0acae41..ad066bd 100644 --- a/content/20240428125606 ダイナミックスコープ レキシカルスコープ.md +++ b/content/20240428125606 ダイナミックスコープ レキシカルスコープ.md @@ -90,4 +90,5 @@ int main(void) - [変数束縛はLispのもう一つの本質である(続き)](http://blog.livedoor.jp/s-koide/archives/1873931.html) ### 参考にしてはいけない +- レキシカルスコープの説明しかない [クロージャ - JavaScript | MDN](https://developer.mozilla.org/ja/docs/Web/JavaScript/Closures) - とてもわかりにくい [動的スコープ - Wikipedia](https://ja.wikipedia.org/wiki/%E5%8B%95%E7%9A%84%E3%82%B9%E3%82%B3%E3%83%BC%E3%83%97) \ No newline at end of file