如何查看common lisp函数的文档?
来源:互联网 发布:mysql查询笔试题及答案 编辑:程序博客网 时间:2024/05/17 19:59
Common Lisp有几百个函数,不可能把所有的函数用法都记得很清楚,所以就希望在编写程序时可以随时的查看函数的文档描述。
首先,我找到documentation函数,其用法是:
(documentation 'symbol 'type)例如,我想查看make-hash-table函数,其用法和结果如下:
CL-USER> (documentation 'make-hash-table 'function)"Create and return a new hash table. The keywords are as follows: :TEST -- Indicates what kind of test to use. :SIZE -- A hint as to how many elements will be put in this hash table. :REHASH-SIZE -- Indicates how to expand the table when it fills up. If an integer, add space for that many elements. If a floating point number (which must be greater than 1.0), multiply the size by that amount. :REHASH-THRESHOLD -- Indicates how dense the table can become before forcing a rehash. Can be any positive number <=1, with density approaching zero as the threshold approaches 0. Density 1 means an average of one entry per bucket."这个返回结果信息很好。但是,对于一些函数如random,其返回的内容就很少:
CL-USER> (documentation 'random 'function)NIL
所以,我希望找到一种可以查看任何函数的方法。
最后,我在slime的manual中找到了查看函数文档的命令:
C-c C-d hM-x slime-hyperspec-lookupLookup the symbol at point in the Common Lisp Hyperspec. This uses the familiar hyperspec.el to show the appropriate section in a web browser. The Hyperspec is found either on the Web or in common-lisp-hyperspec-root, and the browser is selected by browse-url-browser-function.Note: this is one case where C-c C-d h is not the same as C-c C-d C-h.这个命令,默认情况下,会进行在线的查询,需要网络连接正常。为了在不方便上网的时候也可以查看函数文档,我们只需要把Hyperspec文档下载到本地,然后在文件hypersepc.el中修改变量common-lisp-hyperspec-root的值为你本地的路径(即存放Hyperspec文档的路径)。
越来越感觉,只要正确设置好,lisp的交互环境比python的交互环境更强大。
- 如何查看common lisp函数的文档?
- 查看common lisp函数的文档
- 如何查看 Common Lisp 的标准函数
- Common Lisp函数的基础知识
- common-lisp语言文档
- Common Lisp ---- 函数
- Common Lisp的学习
- Common Lisp的配置
- 函数编程之Common Lisp
- Lisp 匿名递归函数 v2:在 Common Lisp 中实现 Clojure 的 fn
- Common Lisp变量的基础知识
- 学习Common Lisp的好书
- Common Lisp的标准容器
- 如何在common lisp 中生成keyword
- 实用Common Lisp编程——函数
- Common Lisp语法——函数定义
- Common Lisp学习之二:使用函数
- Common Lisp笔记(3)函数定义
- 计算1到100以内前5个能被3整除的数字
- 用java实现换位法生成全排列
- 关于使用ETL工具Kettle的简单介绍(一)
- String 和 document 的相互转换总结
- 一个巧妙的自定义UITableViewCell的办法
- 如何查看common lisp函数的文档?
- 广义容斥原理
- SQL SERVER STATISTICS
- Visual Studio error C4335: 检测到 Mac 文件格式: 请将源文件转换为 DOS 格式或 UNIX 格式解决
- jar依赖版本不一致导致的诡异情况
- 变量前面没有加数据类型出现的错误。
- 说出来不好意思:从学C++开始,到现在8年了,才知道的using还有这种用法。
- 改变自己
- hibernate面试题 --- Hibernate是如何延迟加载的