Questions tagged [erl]

The erl program is Erlang Emulator, starting an Erlang runtime system.

The executable script erl is a front-end to the Erlang runtime system. Windows users probably wants to use the werl program instead, which runs in its own window with scrollbars and supports command-line editing.

160 questions
5
votes
2 answers

usage of erlang heart

How should heart be used to keep an application alive? Lets say I have an application X, will it be monitored if I just call something like: erl -boot X -heart -env HEART_BEAT_TIMEOUT 30 -detached ?
Daniel
  • 20,420
  • 10
  • 92
  • 149
5
votes
1 answer

Erlang: Get the first element of each tuple in a list

I can get the first element of every tuple if I create the list at the same time, for example [element(2,X) || X <- [{1,2},{3,4}]]. [2,4] This works as it should. I want to be able to create the list before I try to do anything with it Ex: Create…
Sam
  • 1,765
  • 11
  • 82
  • 176
5
votes
3 answers

Sending json with tsung POST request

I'm trying to create a POST request with Tsung How can I send a JSON document in the contents attribute? contents='{"name": "alex"}' is of course…
Alex
  • 37,502
  • 51
  • 204
  • 332
5
votes
3 answers

"Uncaught error in rebar_core" when trying to build rebar

I have to add and remove nodes on riak. For this, I am trying to build rebar, following the steps in the following link: https://github.com/basho/rebar I am getting the following the about erlang library missing, when I run the bootstrap…
Autumn
  • 339
  • 5
  • 19
4
votes
0 answers

erl_publish failing with partial packet

I am having a strange problem trying to bring up a C-Node Server. I am following the example from http://www.erlang.org/doc/tutorial/cnode.html. I found that I would fail at if (erl_publish(port) == -1) erl_err_quit("erl_publish"); Running epmd…
4
votes
1 answer

Erlang escript: exception error: no match of right hand side value {error,enoent}‏

I encountered the above error while trying to build an Erlang RabbitMQ plugin using MinGW/MSYS on Windows 7 (64 bit). I'm using Erlang v5.10.3 (32 bit). I'm able to run RabbitMQ on my system. Fujitsu@Notebook…
Joshua
  • 1,709
  • 2
  • 24
  • 38
4
votes
2 answers

Erlang case statement

I have the following Erlang code and it is giving the warning as follows, when i try to compile it, but that make sense. function need two arguments, but i need to patten match "everything else" rather x, y or…
Tharanga Abeyseela
  • 3,255
  • 4
  • 33
  • 45
3
votes
2 answers

Function to convert map to a list in erlang

Suppose I have a map like this A = #{a=>1,b=>2,c=>3}. I want to create a function which converts A to a list of tuples of key-value pairs. list = [{a,1},{b,2},{c,3}]
3
votes
1 answer

Creating dirty threads in erlang nif

I am a little bit confused, when I create a dirty NIF (for example, by setting the appropriate flags value for the dirty NIF in its ErlNifFunc entry), this creates a dirty scheduler that runs on a dirty thread. I understand that I can have only N…
ziv
  • 53
  • 3
3
votes
2 answers

How do I remove a character from a list or string in Erlang?

How do I remove the character / from this list (or call it a string) List = "/hi"
emzemzx
  • 165
  • 3
  • 11
3
votes
1 answer

Why do I get syntax error before: '{'?

While playing with Erlang getting started section I have met bizarre syntax error on trivial use case (simple map initialization). Are there any suggestion why does that happen? 1> #{ "key" => 42}. 1: syntax error before: '{' Details: Erlang…
Yehor Nemov
  • 907
  • 2
  • 16
  • 31
3
votes
2 answers

Erlang, how can I create text file with newlines?

Somebody knows how can I append a new line in the text file in Erlang language? I want to save this list: Data = ["one", "two", "three"], into the text file with new lines: one two three I tried: write() -> Data = ["1","2","3"], Print =…
3
votes
1 answer

string value in erlang

I am a newbie in erlang. I have to maintain and implement new feature of an an backend project built in erlang. I have strong background in c/c++, php, ruby, python and javascript. I have had problem in implementing a feature to remove some of the…
channa ly
  • 9,479
  • 14
  • 53
  • 86
3
votes
2 answers

Erlang module to send and receive messages to shell program

Hello awesome erlang community! I've got an erlang module that receives erlang code from the user, it executes the erlang expression and returns the results to the user. Kind of like a shell. Except, there is no variable bindings or command…
Robbie
  • 620
  • 1
  • 5
  • 17
3
votes
3 answers

How to manually send a message to a process which I just spawned?

How can I send a message to process with Erlang? I did start a process and the output shows me that the pid (process identifier) is <0.39.0>. My question is how can I send a message to this process (<0.39.0>) manually.
scof007
  • 415
  • 2
  • 9
  • 15
1
2
3
10 11