erlang shell 模块功能帮助

标签 erlang erlang-shell

我正在 shell 中工作,我想查看函数 io:format/1 的帮助。

我的思路是这样的:

  1. 执行help() - 我找到命令m()。
  2. 执行m(io) - 我看到io模块中的函数列表

问题:如何从 erlang Shell 深入查找函数 io:format/1 的帮助?

<小时/>

help() 的输出。:

1> help().
...
m(Mod)     -- information about module <Mod>
memory()   -- memory allocation information
...
true

来自m(io)的输出。:

2> m(io).
Module io compiled: Date: July 10 2013, Time: 10.46
Compiler options:  [{outdir,"/build/buildd/erlang-16.b.1-dfsg/lib/stdlib/src/../ebin"},
                    {i,"/build/buildd/erlang-16.b.1-dfsg/lib/stdlib/src/../include"},
                    {i,"/build/buildd/erlang-16.b.1-dfsg/lib/stdlib/src/../../kernel/include"},
                    warnings_as_errors,debug_info]
Object file: /usr/lib/erlang/lib/stdlib-1.19.2/ebin/io.beam
Exports: 
columns/1                     parse_erl_form/2
columns/0                     parse_erl_form/3
format/1                      parse_erl_form/4
format/2                      printable_range/0
format/3                      put_chars/2
...
parse_erl_exprs/4             setopts/2
parse_erl_exprs/3             setopts/1
parse_erl_form/1              write/1
                              write/2
ok

最佳答案

与 Python、Lisp 等不同,Erlang 程序和 shell session 无法访问标准库中函数的帮助文本。

我找到文档的方法是使用 URL http://www.erlang.org/doc/man/%s.html 的特殊 Firefox 书签。我将 e 指定为该书签的热键,这样我就可以在 Firefox 地址栏中键入 e io 并重定向到 http://www.erlang.org/doc/man/io.html ,其中包含 io 模块中函数的文档。

或者,您可能会发现 http://erldocs.com/有用。它允许您键入要查找的函数的名称并直接跳转到其文档。

关于erlang shell 模块功能帮助,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25850743/

相关文章:

erlang - 从命令行执行 Erlang 代码中的并发示例

erlang - 如何使用 Ctrl+L 或类似命令清除 erlang 中的屏幕?

http - 处理 HTTP 请求和响应

string - 在元组列表上使用 Map 并将其打印为 Erlang 中的平面字符串

erlang - 执行Erlang脚本时抛出"init terminating in do_boot"

erlang - 如何调整 Erlang VM 配置?

json - 如何将元组列表转换为 Json 字符串

erlang - 如何在 Phoenix 中获取请求正文?

functional-programming - 在 Erlang 中编程时可以忽略线程安全吗?

scala - Actors模型(Scala,Erlang)最适合​​哪种应用程序/服务/组件?