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
1
vote
1 answer

Erlang: check duplicate inserted elements

I want to know if inserted elements are duplicated. Here is simple example for what I'm looking for : In first run should return false. check_duplicate("user", "hi"). But in second run should return true. check_duplicate("user", "hi").
Mr. zero
  • 245
  • 4
  • 18
1
vote
1 answer

Why/When does erl give a Warning: obsolete message?

I have the following code in list.erl: -module(list). -export([average/1]). average(X) when list(X) -> sum(X) / len(X). sum([H|T]) -> H + sum(T); sum([]) -> 0. len([_|T]) -> 1 + len(T); len([]) -> 0. Loading this module in the erl shell gives a…
stark
  • 97
  • 5
1
vote
1 answer

Pass args through rebar shell to erl?

I am using "rebar shell" to test my app. This is documented as: Start a shell with project and deps preloaded similar to 'erl -pa ebin -pa deps/*/ebin'. How do I add extra args to the underlying invocation of 'erl'? For example, I want to add…
Lyn Headley
  • 11,368
  • 3
  • 33
  • 35
1
vote
1 answer

check for item in list in Erlang

I'm trying to make check function in Erlang I have one word and list of word list_word() -> ["bad1", "bad2", "bad3"]. And I'm trying to check if this word in list return true except return false example : check_list() -> badword =…
emzemzx
  • 165
  • 3
  • 11
1
vote
1 answer

Getting the Erlang shell to forget a BIF

Is there any way I can get Erlang to forget a built in function so I can use that name? eg. forget retrieve
1
vote
2 answers

Adding to an existing value in Erlang

I am attempting to create a function that stores a number into a record and then adds value X to that number every time the function runs. Value: 5 Run Function (Add One): 1 Value should be: 6 Run Function (Add One): 1 value should be 7 I tried…
Jonathan
  • 545
  • 1
  • 8
  • 27
1
vote
1 answer

Oracle DB connection handler in Erlang

I am new to erlang, sorry I might be missing something very small. I am trying the following code for a DB handler to oracle in Erlang, in red-hat. #!/usr/bin/env escript -module(test). -compile(export_all). -define(CONNECT_OPTIONS,[ …
Jnana
  • 61
  • 5
1
vote
1 answer

Why doesn't my Erlang shell load rebar dependencies?

I have a simple project using rebar with this config: {sub_dirs, [ "gen", "apps/basilisk_server", "rel" "apps/*" "ebin" "deps/*/ebin" ]}. …
Selali Adobor
  • 2,060
  • 18
  • 30
1
vote
1 answer

Elixir io_lib call to erlang

io_lib:fread("~d/~d/~d", "2013/03/03"). Above code works in erlang so ideally in elixir below code should work :io_lib.fread("~d/~d/~d", "2013/03/03") but it generates error " no function clause matching " After inspecting found that elixir makes…
Jack Daniel's
  • 2,583
  • 22
  • 28
1
vote
1 answer

Erlang: What happens when you f() a Pid in erl?

Say I'm working with some simple processes in erl: 1> Fun = fun(F) -> F(F) end. #Fun 2> Pid = spawn(fun() -> Fun(Fun) end). <0.178.0> 3> f(Pid). What happens when I do f(Pid).? Does the process exit or do I just lose my…
2rs2ts
  • 10,662
  • 10
  • 51
  • 95
1
vote
1 answer

starting erlang with command line args works, with args_file doesn't

I rigged up a very simple little OTP application in erlang by following the amazing "How to create a HTTP API with Erlang in 10 Minutes": https://vimeo.com/59832641 It works perfectly when I start erl with command line args as demonstrated in the…
nerophon
  • 89
  • 1
  • 10
1
vote
1 answer

Can the `erl -make` command be extended to do things other than compiling .erl files?

I wanted to integrate Elixir into our project, and the good old codes don't use rebar, so I think writing the rules for building .ex files into Emakefile may be a good idea, yet the man page here didn't mention anything relevant. Edit: Our team…
l04m33
  • 586
  • 3
  • 12
0
votes
1 answer

Why are erlang lib changes not being incorporated into my project?

I'm using eclipse 3.6.2 with erlang 5.8.1.1 on a fairly large project that we're not ready to move to a more modern version of the language, so I'm stuck with a bug in eprof: string_bp_mfa([{Mfa, {Count, Time}}|Mfas], Tus, {MfaW, CountW, PercW,…
Sniggerfardimungus
  • 11,583
  • 10
  • 52
  • 97
0
votes
1 answer

How to config and get value in plugin emqx

i'm using emqx v5 to pub,sub, connect, v.v.. Meanwhile, I've been developing my plugin and plugin template from this. Normally, in emqx-plugin-template.erl, i declare my constant like this and i can use it from all funtion in this file. But now i…
0
votes
0 answers

Transform the ERL in python

Transform the ERL for one or more selection statements to decide whether a year is a Leap year. The rules are: A year is generally a Leap Year if it is divisible by 4, except that if the year is divisible by 100, it is not a Leap year, unless it is…
max
  • 1