<div dir="ltr">in my computer, the two DEBUG macro all work corretly. my erlang otp is R12B-3.<br><br><div class="gmail_quote">2008/8/10 Lasaro <span dir="ltr"><<a href="mailto:lasaro@gmail.com">lasaro@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Sorry, I sent the message before it was ready (twice!). The question<br>
was<br>
why does this definition gives me a "variable 'Param' unsafe in<br>
'case'".<br>
<div class="Ih2E3d"><br>
-define(debug,true).<br>
<br>
-ifdef(debug).<br>
-define(DEBUG(Msg),<br>
case Msg of<br>
[] -><br>
io:format("{~p@~p:~p}", [?MODULE,?LINE,self()]);<br>
[[_|_]=Format, [_|_]=Param] -><br>
io:format(lists:append(["{~p@~p:~p} ",Format]), [?MODULE,?<br>
LINE,self()|Param]);<br>
[_|_] -><br>
io:format("{~p@~p:~p} "++Msg, [?MODULE,?LINE,self()]);<br>
_ -><br>
io:format("{~p@~p:~p} wrong debug call", [?MODULE,?<br>
LINE,self()])<br>
end).<br>
-else.<br>
-define(DEBUG(_M), true).<br>
-endif.<br>
<br>
</div>but this one does not?<br>
<div class="Ih2E3d"><br>
-define(debug,true).<br>
<br>
-ifdef(debug).<br>
deb(Msg)-><br>
case Msg of<br>
[] -><br>
io:format("{~p@~p:~p}", [?MODULE,?LINE,self()]);<br>
[[_|_]=Format, [_|_]=Param] -><br>
io:format(lists:append(["{~p@~p:~p} ",Format]), [?MODULE,?<br>
LINE,self()|Param]);<br>
[_|_] -><br>
io:format("{~p@~p:~p} "++Msg, [?MODULE,?LINE,self()]);<br>
_ -><br>
io:format("{~p@~p:~p} wrong debug call", [?MODULE,?<br>
LINE,self()])<br>
end.<br>
<br>
-define(DEBUG(Msg), deb(Msg)).<br>
-else.<br>
-define(DEBUG(_M), true).<br>
-endif.<br>
<br>
</div>Cheers.<br>
Lásaro<br>
<div><div></div><div class="Wj3C7c">_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br>
</div></div></blockquote></div><br></div>