common-lisp - 如何在 Quicklisp 中获取包文档

标签 common-lisp quicklisp

每次使用 Quicklisp 时,我都觉得我在玩彩票。我找不到包含包列表和文档的网页。

作为一个具体的例子,我搜索了 (ql:system-apropos "random-access-list")因为我ound an implementation of SRFI-101 ,它基于 Okasakis 纯函数数据结构,在 CL 中。我试过这个:

[1]> (ql:system-apropos-list "random-access-lists")
(#<QL-DIST:SYSTEM random-access-lists / random-access-lists-20120208-git / quicklisp 2016-03-18>)
[2]> 

我知道名字random-access-lists不是很具体,因此可能还有其他具有该名称的软件包。上次我不太幸运,找到了 4 个部分匹配,其中最匹配的不是我要找的包。

如何找到有关搜索结果的更多信息?

最佳答案

一个有点hacky的解决方案是下载系统并使用ASDF:SYSTEM-DESCRIPTION查看它的描述。就像是

(defun describe-ql-system (system)
  (let ((system (asdf:find-system
                 (ql-dist:name
                  (ql-dist:ensure-installed
                   (ql-dist:find-system system))))))
    (format t "~a~%~@[~a~%~]"
            (asdf:system-description system)
            (asdf:system-long-description system))))

(describe-ql-system :random-access-lists)
; Persistent, random-access lists.

一个稍微精致的版本:
(defun describe-ql-system (system)
  (let ((system (if (typep system 'ql-dist:system)
                    system
                    (ql-dist:find-system system))))
    (unless (null system)
      (ql-dist:ensure-installed system)
      (handler-case
          (let* ((name (ql-dist:name system))
                 (system (asdf:find-system name)))
            (format t "~&~60,,,'=<~; ~a ~;~>~@
                       ~@[Author:         ~a~%~]~
                       ~@[Maintainer:     ~a~%~]~
                       ~@[Description:    ~a~%~]~
                       ~@[Long description:~@
                       ~a~%~]~%"
                    name
                    (asdf:system-author system)
                    (asdf:system-maintainer system)
                    (asdf:system-description system)
                    (asdf:system-long-description system)))
        (asdf:missing-component ())))))

关于common-lisp - 如何在 Quicklisp 中获取包文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38684906/

相关文章:

common-lisp - 有没有办法在 Mac OS 上使用动态 FFI 支持编译 CLISP?

# 符号的 LISP 含义

lisp - <<错误打印对象>> lisp - matlisp

Windows 7 上的 LispWorks 无法加载 Quicklisp

lisp - 我应该什么时候声明函数返回类型?

file - Quicklisp 库

lisp - 查找 Common Lisp 库

performance - Lisp:衡量函数的性能

lisp - 对排序的整数列表进行分组的惯用方法?

file-io - 使用 Common Lisp 读取文件