问题标签 [erlang-shell]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
382 浏览

amazon-web-services - 使用 erlang 库 kinetic 连接到 AWS Kinesis

我正在尝试使用 erlang 库动力学连接到 kinesis。https://github.com/AdRoll/kinetic ...我的 development.config 中有我的 aws 密钥和秘密,但是我不确定 metadata_base_url 应该是什么,或者我还需要什么才能使其工作.. .目前我有:

以下是我尝试启动它时的结果...

删除 base_url 配置时...

0 投票
2 回答
385 浏览

erlang - Erlang Shell 工作目录

我正在将 Ideaj 配置为通过将其设置为外部工具来打开 Erlang REPL,但是工作目录参数被忽略。有没有办法在 REPL 打开后切换工作目录?

0 投票
2 回答
1876 浏览

erlang - 模式匹配 Erlang 字符串作为函数中的列表

我最近开始研究 Erlang,遇到了一个我无法解释的奇怪异常。

我的源代码如下:

计算字符串中右大括号和左大括号的数量的非常基本的代码。

在 Erlang shell 中,当我尝试调用函数 is_balanced 时: balanced_brackets:is_balanced("{}").

输出以下错误:

** exception error: no function clause matching balanced_brackets:is_balanced("{}",0,0) (balanced_brackets.erl, line 7)

但是,如果我将参数作为显式列表传递,则模式匹配可以正常工作: balanced_brackets:is_balanced(["{", "}"]).

Erlang 字符串不是简单地在内部列出吗?为什么使用构造模式匹配字符串是不正确的[H | T]

执行 BIFis_list("{}").返回true

我真诚地感谢有人对例外的解释。

谢谢你。

Erlang/OTP 17 [erts-6.2] [source-aaaefb3] [64-bit] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]

0 投票
2 回答
332 浏览

concurrency - File Server erlang response

I am trying to follow the very first example given in the Programming Erlang, Software for a concurrent world by Joe Armstrong. Here is the code:

Then I run this in the shell:

In the book a list of the files is returned as expected however in my shell it looks as if the program has frozen. Nothing gets returned yet the program is still running. I'm not familiar at all with erlang however I can understand how this should work.

I'm running this in Windows 7 64-bit. The directory is not empty as it contains a bunch of other erlang files.

0 投票
1 回答
45 浏览

erlang - 变量在 Erlang 中绑定一次

编辑:我更改了这个问题的标题,因为鉴于我犯的 n00b 错误,它没有用。其余部分没有变化,并作为一个警示故事!

我正在使用 Erlang OTP 17.4 版。考虑以下 Erlang shell 会话,我正在尝试使用trap_exit进程标志,如"Learn You Some Erlang:Errors and Processes"中所述。

首先,我设置了trap_exit将链接进程中的退出信号转换为常规消息的标志:

然后我生成一个链接进程并立即通过调用终止它exit/2

然后我阅读了转换后的退出消息:

到目前为止,一切看起来都很好,就像书中描述的那样。现在,只是为了好玩,我spawn_link终止了另一个进程:

并尝试阅读转换后的退出消息:

此时外壳挂起。我的问题是为什么第二次的行为会发生变化,退出消息去了哪里?

0 投票
1 回答
56 浏览

erlang - Robotnik (Erlang) 博士命令和变量

我正在使用以下代码:

https://github.com/kivra/robotnik

而且我无法让引擎开始刮擦。我怀疑这是因为我不熟悉启动引擎所需的命令。

编译后,命令“ robot_example:init("search").”返回响应“ {ok,[search,browse],[]}”。

同样,“ robot_example:kill().”将返回一个“ {ok}”。

现在,我知道我需要两个参数来表示“ robot_example:attack”,其中第一个是“搜索”或“浏览”,我相信你可能会遇到这种情况。我不确定的是变量“_State”所需的参数,以便让引擎运行和处理。

欢迎任何指点!

0 投票
1 回答
79 浏览

erlang - Erlang shell 函数 i() 的文档,或者哪个模块导出它?

我正在尝试查找有关i()shell 函数的文档,推荐用于检查内存消耗。我无法弄清楚哪个模块导出了该功能。

0 投票
1 回答
7785 浏览

erlang - 没有匹配erlang的函数子句

我刚拿起 Erlang,遇到了一个简单的问题,但我无法修复它或找到任何关于它的东西。我正在尝试定义一个模块来检查是否atom在给定列表中。我通过 Erlang shell 进入列表,如下所示:

veggies:veggieMember([cucumber,tomato,potato],tomato).

但我总是得到exception error: no function clause matching

也许我误解了基础知识,但这是我想要做的模块代码:

0 投票
1 回答
445 浏览

erlang - Erlang 在我的一个安装上映射语法错误

我在我的 Mac (OS X) 和 Ubuntu 14.04 电脑上安装了 Erlang。尝试在 Mac 上创建地图,但完全相同的代码在我的 Ubuntu 电脑上产生错误。我已经在另一台计算机上尝试过它,它也在那里工作。这是代码:

这是来自这里的示例代码。在我的 Ubuntu 安装上,它说syntax error before {.

我的 Erlang 版本可能是某种问题吗?我是从 aptitude 安装的。当我启动它时,它显示“Eshell V5.10.4”。

如果我将代码写在一个文件中并尝试从 shell 编译它,也是一样的。

0 投票
3 回答
265 浏览

erlang - 如何使程序在erlang中保留ASCII值?

我有一个从 erlang shell 输入的函数:

我想保持这样的 ASCII 值,但我的在输出中被更改为整数。如何使程序不将它们解释为整数?