Erlang
Pull request Compare This branch is 9 commits ahead of JonGretar:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
EMakefile
README.markdown
user_default.erl

README.markdown

A collection of handy user utilities for the Erlang shell. Read this blog post for background.

reload()            %   reload changed modules
tc_avg(M, F, A, N)  %   run timer:tc(M, F, A) N times and return range,
                    %     average and median results skipping the first
                    %     run.

Debugger helper functions:

dbg()               %   start the debugger (done automatically for all
                    %     calls)
dbg(c)              %   clear all traces

dbg(M)              %   trace on module M
dbg(M, O)           %   trace on module M with options O
dbg(M, F)           %   trace on function M:F
dbg(M, F, O)        %   trace on function M:F with options O
dbg(M, F, A)        %   trace on function M:F(A)
dbg(M, F, A, O)     %   trace on function M:F(A) with options O

The options for debugging are:

c                   %   clear
r                   %   show return trace (including exceptions).
l                   %   trace on local functions
lr                  %   trace on local functions with return trace 
                    %     (including expections)

Add the following to ~/.erlang to enable them:

code:load_abs("/Path/To/erlang_user_utilities/user_default").