我正在使用http://rextester.com/runcode进行一些方案测试。
当我跑
(define x (cons 3 null))
(write x)
Run Code Online (Sandbox Code Playgroud)
它有一个ERROR: Unbound variable: null.
如何在上述上下文中引用空列表?
(define x (cons 3 '()))
(write x)
Run Code Online (Sandbox Code Playgroud)
null或者,您可以先定义:
(define null '())
(define x (cons 3 null))
(write x)
Run Code Online (Sandbox Code Playgroud)