小编yan*_*ics的帖子

需要帮助运行线程 SBCL

我正在 sbcl 上编写一些 lisp 代码,以便在守护进程模式下运行函数。问题是当我使用函数 sb-thred:make-thread 时,例如如下:

(sb-thread:make-thread (lambda () (progn (sleep 1) (when t (print "background action")))))
Run Code Online (Sandbox Code Playgroud)

我收到以下错误消息:

Not supported in unithread builds. [Condition of type SIMPLE-ERROR]
Run Code Online (Sandbox Code Playgroud)

怎么了 ?... 感谢帮助。

sbcl common-lisp background-thread

4
推荐指数
1
解决办法
2469
查看次数

使用defparameter定义变量,其名称在运行时确定

我想使用defmethoddefun使用其中一个参数动态启动哈希表来创建名称.例如:

(defun foo (arg)
  (let ((NAME (read-from-string (format nil "\*~S\*" arg))))
    (defparameter NAME (make-hash-table))))
Run Code Online (Sandbox Code Playgroud)

当然,foo使用符号创建哈希表NAME,而不是NAMEin 的值let.我该怎么做才能获得NAME创建这个哈希表的价值?

lisp common-lisp

1
推荐指数
1
解决办法
415
查看次数

标签 统计

common-lisp ×2

background-thread ×1

lisp ×1

sbcl ×1