erlang-shell

    1熱度

    2回答

    我目前在教我自己的Erlang。一切都很順利,直到我發現這個功能有問題。 -module(chapter). -compile(export_all). list_length([]) -> 0; list_length([_|Xs]) -> 1+list_length([Xs]). 這是從教科書中提取出來的。當我使用OTP 17運行此代碼時,它只是掛起,意味着它只是如下所示。 1>

    2熱度

    2回答

    我有一個表具有以下屬性做一個ETS表查找: SortCode Index Created SortCode是主鍵和Index是次要的關鍵。給定Index的值,我如何獲得關聯的SortCode值?我試過ets:lookup/3,但它只需要一個主鍵。

    1熱度

    2回答

    我開始是這樣的: [[email protected] rabbitmq_server-3.5.6]# erl -pa ebin Erlang/OTP 18 [erts-7.1] [source] [64-bit] [async-threads:10] [hipe] [kernel-poll:false] Eshell V7.1 (abort with ^G) 1> -include("i

    1熱度

    1回答

    這是我的代碼片段。 %% test.erl -export([count_characters/1]). count_characters(Str) -> count_characters(Str, #{}). count_characters([H|T], #{H := N} = X) -> count_characters(T, X#{H := N+1}); c

    1熱度

    2回答

    我最近開始研究Erlang並遇到了一個我無法解釋的奇怪異常。 我的源代碼如下: -module(balanced_brackets). -author("Irrelevant"). -compile(export_all). is_balanced(String) -> is_balanced(String, 0, 0). is_b

    2熱度

    2回答

    我想要遵循編程Erlang,喬阿姆斯特朗併發世界軟件中給出的第一個例子。下面是代碼: -module(afile_server). -export([start/1,loop/1]). start(Dir) -> spawn(afile_server,loop,[Dir]). loop(Dir) -> receive {Client, list_dir} ->

    0熱度

    1回答

    我啓動Erlang的外殼採用SASL啓動,並用下面的配置文件,但它不會在磁盤上創建一個錯誤日誌:如果我把"."作爲目錄值 %% rotating log and minimal tty [{sasl, [ {sasl_error_logger, false}, %% define the parameters of the rotating log %% the log file dir

    4熱度

    1回答

    當我發送原子作爲消息時,原子是否從一個進程複製到另一個進程?我的想法是,因爲這個原子已經存在於虛擬機中,所以不需要複製。我知道二進制文件在從一個進程發送到另一個進程時效率更高。 如果我發送觸發消息,從一個進程到另一個常量消息,哪個更好用:atom還是binary?

    3熱度

    2回答

    Learn some Erlang或IEx是如何着色REPL外殼的?是kjell穩定的替代品?

    0熱度

    1回答

    我使用的代碼: https://github.com/kivra/robotnik ,但無法獲得發動機開始刮。我懷疑這是因爲我不熟悉啓動引擎所需的命令。 編譯後,命令「robot_example:init("search").」返回響應「{ok,[search,browse],[]}」。 同樣,「robot_example:kill().」將返回「{ok}」。 現在,我知道我需要「robot_ex