<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7233.28">
<TITLE>RE: dbg match spec</TITLE>
</HEAD>
<BODY>
<DIV dir=ltr><PRE dir=ltr>Hi, but are you allowed to have a '$1' variable to match the<BR>entire list of arguments?<BR>And if you are, then '$$' must expand to a list of a list<BR>('$$' means a list of all $variable bindings). Hence it must<BR>be [[{'A',foo,bar}]] of which then element 1 will not be<BR>applicable!?</PRE><PRE dir=ltr>>[{'$1',[{'==',{element,1,'$$'},'A'}],[call]}]).<BR></PRE></DIV><PRE dir=ltr>Best Regards,<BR>Lennart</PRE>
<DIV id=idSignature11470 dir=ltr>
<DIV><FONT face="Courier New" color=#000000
size=2>-------------------------------------------------------------</FONT></DIV>
<DIV><FONT face="Courier New" color=#000000 size=2>Lennart
Ohman
phone : +46-8-587 623 27</FONT></DIV>
<DIV><FONT face="Courier New" size=2>Sjöland & Thyselius Telecom
AB cellular: +46-70-552 6735</FONT></DIV>
<DIV><FONT face="Courier New" size=2>Sehlstedtsgatan
6
fax : +46-8-667 8230</FONT></DIV>
<DIV><FONT face="Courier New" size=2>SE-115 28 STOCKHOLM,
SWEDEN email : <A
href="mailto:lennart.ohman@st.se">lennart.ohman@st.se</A></FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>Från:</B> owner-erlang-questions@erlang.org genom
Ulf Wiger (AL/EAB)<BR><B>Skickat:</B> må 2005-10-03 13:09<BR><B>Till:</B>
chandru; erlang-questions@erlang.org<BR><B>Ämne:</B> RE: dbg match
spec<BR></FONT><BR></DIV>
<DIV><BR>
<P><FONT size=2>Sorry Chandru, I can't figure it out
either.<BR><BR>/Uffe<BR><BR>> -----Original Message-----<BR>> From:
owner-erlang-questions@erlang.org<BR>> [<A
href="mailto:owner-erlang-questions@erlang.org">mailto:owner-erlang-questions@erlang.org</A>]On
Behalf Of chandru<BR>> Sent: den 3 oktober 2005 12:19<BR>> To:
erlang-questions@erlang.org<BR>> Subject: dbg match
spec<BR>><BR>><BR>> Hi,<BR>><BR>> If I had code like
this:<BR>><BR>> -module(dbg_test).<BR>>
-export([test/1]).<BR>><BR>> test(N) when integer(N)
-><BR>> io:format("Integer -> ~p~n",
[N]);<BR>> test({'A', X, Y}) -><BR>>
io:format("A: X -> ~p, Y -> ~p~n", [X,Y]);<BR>> test(L)
-><BR>> io:format("L -> ~p~n",
[L]).<BR>><BR>> how would I write a dbg command to print out a trace when
the second<BR>> clause is matched?<BR>><BR>> I've tried:
<BR>><BR>> dbg:tpl(dbg_test, test, 1,<BR>>
[{'$1',[{'==',{element,1,'$$'},'A'}],[call]}]).<BR>><BR>> but it doesn't
work. whereas this does:<BR>><BR>> dbg:tpl(dbg_test, test, 1,
[{'_',[],[call]}]).<BR>><BR>> but it is not quite what I want...I want to
single out the<BR>> second clause.<BR>><BR>> cheers<BR>>
Chandru<BR>><BR></FONT></P></DIV>
</BODY>
</HTML>