从我的包管理器安装 Common Lisp 后如何使用 CLX/XLIB?
How do I use CLX/XLIB from Common Lisp after installing it from my package manager?
我正在尝试在学习 common lisp 的同时使用 CLX,因为我认为如果我有实际的、有形的、实用的结果,学习它会更有效。不幸的是,我无法让 CLX 工作。在 debian 中安装 clisp
和 clisp-module-clx
软件包后,我关注 the first bit of this tutorial。
我想我只是严重误解了 clisp 的包/模块/等等加载系统,但我找不到任何资源来了解如何做到这一点。
foo.lisp:
(defun pop-up-window (life-time &optional (host ""))
(let* ((display (xlib:open-display host))
(screen (first (xlib:display-roots display)))
(root-window (xlib:screen-root screen))
(my-window (xlib:create-window
:parent root-window
:x 0
:y 0
:width 200
:height 300)))
(xlib:map-window my-window)
(xlib:display-finish-output display)
(format t "it should be here ~%")
(sleep life-time)
(xlib:destroy-window my-window)
(xlib:close-display display)
)
(pop-up-window 10)
输出: there is no package with name "XLIB"
编辑:
我在代码的开头尝试了 (require "clx")
,但我得到了 #<PACKAGE COMMON-LISP> is locked
。
我正在尝试在学习 common lisp 的同时使用 CLX,因为我认为如果我有实际的、有形的、实用的结果,学习它会更有效。不幸的是,我无法让 CLX 工作。在 debian 中安装 clisp
和 clisp-module-clx
软件包后,我关注 the first bit of this tutorial。
我想我只是严重误解了 clisp 的包/模块/等等加载系统,但我找不到任何资源来了解如何做到这一点。
foo.lisp:
(defun pop-up-window (life-time &optional (host ""))
(let* ((display (xlib:open-display host))
(screen (first (xlib:display-roots display)))
(root-window (xlib:screen-root screen))
(my-window (xlib:create-window
:parent root-window
:x 0
:y 0
:width 200
:height 300)))
(xlib:map-window my-window)
(xlib:display-finish-output display)
(format t "it should be here ~%")
(sleep life-time)
(xlib:destroy-window my-window)
(xlib:close-display display)
)
(pop-up-window 10)
输出: there is no package with name "XLIB"
编辑:
我在代码的开头尝试了 (require "clx")
,但我得到了 #<PACKAGE COMMON-LISP> is locked
。