Skip to content

Instantly share code, notes, and snippets.

@noqisofon
Last active August 27, 2025 12:56
Show Gist options
  • Save noqisofon/a312022a0a04ea6eca74a2c1cd2de69a to your computer and use it in GitHub Desktop.
Save noqisofon/a312022a0a04ea6eca74a2c1cd2de69a to your computer and use it in GitHub Desktop.
( ノ╹◡◡╹)ノ 真の REPL について
  • まだ定義されていない関数 bar を呼び出す関数 foo を定義する:
* (defun foo ()
     (bar))
; in: defun foo
;     (bar)
;
; caught style-warning:
;   undefined function common-lisp-user:bar
;
; compilation unit finished:
;   Undefined function:
;     bar
;   caught 1 style-warning codition
foo
  • なんか警告が出るが、定義できたみたいだ。
  • それでは早速 foo を呼び出してみる:
* (foo)
debugger invoked on a undefined-function @1000000C2C in thread
#<thread tid="24004 "main thread" running {1100BC8003}>:
  The function common-lisp-user:bar is undefined.

Type `help` for debugger help, or `(sb-ext:exit)` to exit form sbcl.

restarts (invokable by number or by possibly-abbreviated name):
  0: [continue      ] Retry calling bar.
  1: [use-value     ] Call specified function.
  2: [return-value  ] Return specified values.
  3: [return-nothing] Return zero values.
  4: [abort         ] Exit debuffer, retunring to top level.

("undefined function")
0]
  • 0] が debugger なプロンプト。
  • よくわからないが、 user-value を選びたいので 1 を入力する。
0] 1
  • なんかプロンプトが出た。
  • bar を定義すればいいのか…?
Enter a from to be evaluated: 
  • 定義してみた:
Enter a from to be evaluated: (defun bar () (write-line "Hello, World!"))
  • というわけで、へろーわーるどが出た。
Hello, World!
"Hello, World!"
  • もっかいやってみたところ、debugger プロンプトで普通に bar を定義できて、0 でもっかい bar を呼び出すこともできるっぽいwww
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment