[erlang-questions] Dot before call in EUNIT

Dmitry Klionsky dm.klionsky@REDACTED
Fri Nov 23 13:46:42 CET 2012


Hi everybody!

I was looking inside eunit.hrl and found a number of defines like this one:

-define(assertMatch(Guard, Expr),
     ((fun () ->
         case (Expr) of
         Guard -> ok;
         __V -> .erlang:error({assertMatch_failed,
                       [{module, ?MODULE},
                        {line, ?LINE},
                        {expression, (??Expr)},
                        {pattern, (??Guard)},
                        {value, __V}]})
         end
       end)())).
-endif.

What is interesting for me is the DOT before the call. I've never seen 
it before. I've googled, but found nothing.

Then I grepped:
/opt/otp-r15b01/lib/erlang/lib $ grep -E ' \.[a-z]+:[a-z]+' ./*/*/*.{e,h}rl

./eunit-2.2.2/include/eunit.hrl: 
.erlang:process_info(.erlang:group_leader(),
./eunit-2.2.2/include/eunit.hrl:        __V -> 
.erlang:error({assertion_failed,
./eunit-2.2.2/include/eunit.hrl:        __V -> 
.erlang:error({assertMatch_failed,
./eunit-2.2.2/include/eunit.hrl:        Guard -> 
.erlang:error({assertNotMatch_failed,
./eunit-2.2.2/include/eunit.hrl:        __V -> 
.erlang:error({assertEqual_failed,
./eunit-2.2.2/include/eunit.hrl:        __X -> 
.erlang:error({assertNotEqual_failed,
./eunit-2.2.2/include/eunit.hrl:            __V -> 
.erlang:error({assertException_failed,
./eunit-2.2.2/include/eunit.hrl: .erlang:error({assertException_failed,
./eunit-2.2.2/include/eunit.hrl: .erlang:get_stacktrace()}}]})
./eunit-2.2.2/include/eunit.hrl: .erlang:error({assertNotException_failed,
./eunit-2.2.2/include/eunit.hrl: .erlang:get_stacktrace()
./eunit-2.2.2/include/eunit.hrl:        {__N, _} -> 
.erlang:error({command_failed,
./eunit-2.2.2/include/eunit.hrl:        {__N, _} -> 
.erlang:error({assertCmd_failed,
./eunit-2.2.2/include/eunit.hrl:        {_, __T} -> 
.erlang:error({assertCmdOutput_failed,
./eunit-2.2.2/include/eunit.hrl:         .io:fwrite(user, <<"~s:~w:~w: 
~s\n">>,

So only EUNIT uses this notation. It seems like a historical artifact 
left from ancient times.
My question is mainly to erlang veterans. What this DOT is/was about?

Best regards,
Dmitry Klionsky




More information about the erlang-questions mailing list