Small macro doco bug?

Brian Candler <>
Mon Dec 6 14:57:47 CET 2010


[I'm not sure whether documentation corrections should go to erlang-bugs or
not - so I'm sending it here for now]

At http://www.erlang.org/doc/reference_manual/macros.html

----------------------------------------------------------------------------
Example:

-define(TESTCALL(Call), io:format("Call ~s: ~w~n", [??Call, Call])).
?TESTCALL(myfunction(1,2)),
?TESTCALL(you:function(2,1)).

results in

io:format("Call ~s: ~w~n",["myfunction ( 1 , 2 )",m:myfunction(1,2)]),
io:format("Call ~s: ~w~n",["you : function ( 2 , 1 )",you:function(2,1)]).
----------------------------------------------------------------------------

I think the "m:" is spurious in front of myfunction(1,2). I have tested this
using erl_pp to convert the abstract form back to erlang, and I get:

testfunc() ->
    io:format("Call ~s: ~w~n",
              ["myfunction ( 1 , 2 )",myfunction(1, 2)]),
    io:format("Call ~s: ~w~n",
              ["you : function ( 2 , 1 )",you:function(2, 1)]).

Regards,

Brian.


More information about the erlang-questions mailing list