erl

Speeding up the Erlang Edit, Compile, Run/Debug cycle

我的未来我决定 提交于 2019-12-04 08:38:27
问题 What is the fastest way to edit an Erlang application, compile the code and see the running result? Preferably jumping in the Erlang shell on the last step. My current newbie setup: A script that compiles the app and starts up the erl shell. Then I type in application:start(foo). When I fix a typo I recompile the module with c('module') and restart the app. Is there a faster way? BTW. my editor of choice is Emacs. 回答1: Here's my setup: While developing, I keep the Erlang shell open in a

How to use Stacktrace to return Error Line Number in vb.net

ぐ巨炮叔叔 提交于 2019-12-03 03:13:37
I am trying to create some sort of error catching method that will return the error line number. We have an abort email that is sent out when a process aborts that gives us the err.number and err.description but I would like to know where is actually errors out. I know you can do the following: 1: code here 2: code here 3: code here etc. and use ERL to get the number but it would be tedious to type each line out like that. Is there either a way to automatically do this or would it be easier to use Stacktrace? If Stacktrace is better could you please show me an example? Generating line numbers

Speeding up the Erlang Edit, Compile, Run/Debug cycle

孤人 提交于 2019-12-03 00:20:10
What is the fastest way to edit an Erlang application, compile the code and see the running result? Preferably jumping in the Erlang shell on the last step. My current newbie setup: A script that compiles the app and starts up the erl shell. Then I type in application:start(foo). When I fix a typo I recompile the module with c('module') and restart the app. Is there a faster way? BTW. my editor of choice is Emacs. Here's my setup: While developing, I keep the Erlang shell open in a separate terminal window. I start compilation from the editor (using an key combination), or just by typing make

Adding to an existing value in Erlang

最后都变了- 提交于 2019-12-02 03:02:08
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 to use a record: -record(adder,{value :: integer()}). ---function Number = random:uniform(6), L=#added{value = Number + #added.value}. This does not work as it resets the value every time. Any suggestions? Take a look at this code: -module(test). -export([add/1]). -record(adder, {value=6}). add(X) -> #adder{value = X + #adder.value}. If you compile this

Getting two erl shells to talk on OS X

▼魔方 西西 提交于 2019-12-01 17:16:42
I want to be able to have two Erlang shells to talk. I'm running on OS X. I tried the tut17 example here . I've also tried: $ erl -sname foo and then in a new Terminal: $ erl -sname bar (bar@elife)1> net_adm:ping(foo@elife). pang Any ideas? It's kind of broken on the mac. By default, the mac can't resolve its own shortname. Your host's name is really probably "elife.local". If you start erl with -name FQDN, then the pings will work. ie: you would start it with $ erl -name foo@elife.local this probably could be fixed by making the mac capable of resolving it's own short name Here's example

Load all erlang modules in path

Deadly 提交于 2019-12-01 02:12:27
问题 Using the answer from Easy way of loading projects with rebar dependencies, dependencies are now automatically resolved, but they are not automatically loaded. So, how can I load all the modules in my ebin and /deps/*/bin path automatically? That way they are available when using the Erlang shell tab completion, which speeds up my dev process considerably. My solution based on the great answer of Adam Lindberg : https://gist.github.com/1131312 It will only load the project modules

rabbitmq-server installation CentOS - Erlang Error

荒凉一梦 提交于 2019-11-30 16:32:51
I have centos 6 and trying to install rabbitmq 3.5.3 using rpm. ( do not have option for yum ) its throwing me below eror. [root@osboxes CentOS]# rpm -Uvh rabbitmq-server-3.5.3-1.noarch.rpm warning: rabbitmq-server-3.5.3-1.noarch.rpm: Header V4 DSA/SHA1 Signature, key ID 056e8e56: NOKEY error: Failed dependencies: erlang >= R13B-03 is needed by rabbitmq-server-3.5.3-1.noarch But I have already installed erlang [root@osboxes CentOS]# which erl /usr/bin/erl [root@osboxes CentOS]# [root@osboxes CentOS]# erl Erlang/OTP 17 [erts-6.0] [source-07b8f44] [64-bit] [async-threads:10] [hipe] [kernel-poll

What do the Erlang emulator info statements mean?

左心房为你撑大大i 提交于 2019-11-27 04:16:36
问题 When I start up my Erlang emulator, there the first bit has a bunch of informational things. (Slightly reformatted for effect.) manoa:~ stu$ erl Erlang (BEAM) emulator version 5.6.5 [source] [smp:2] [async-threads:0] [hipe] [kernel-poll:false] Eshell V5.6.5 (abort with ^G) 1> Some of it I can guess at, probably accurate, but some of it means 'here be magic'. Erlang (BEAM) emulator version 5.6.5 : the version, of course [source] : the emulator was compiled from source? [smp:2] : two CPU cores