times
is a list of times i.e. matching {{hour_, min_, sec_Real}..}
.
I want to call f[Dynamic@times]
.
The following works for a single argument to the function;
f[Dynamic@(times: {{_, _, _Real}..})]
Edited; The single argument version above works. The multiple argument version below which is closer to the actual code I am using doesn't.
timestamps = {{2008, 1, 2, 14., 31., 0.}, {2008, 1, 2, 14., 32., 0.}};
bars = {{36.67, 36.69, 36.61, 36.65, 20800.}, {36.68, 36.71, 36.68, 36.68,
2600.}};
dates = {{2008, 1, 2}, {2008, 1, 2}};
times = {{14., 31., 0.}, {14., 32., 0.}};
indicators = {36.69, 36.71};
In[203]:= Clear@FormatCoordinates;
FormatCoordinates[pt_, timestamps_, bars_, indicators_] :=
Block[{}, "Matched non-dynamic version 1."]
FormatCoordinates[pt_, dates_, times : {{_, _, _Real} ..},
indicators_] := Block[{}, "Matched non-dynamic version 2."]
FormatCoordinates[pt_, Dynamic@timestamps_, Dynamic@bars_,
Dynamic@indicators_] := Block[{}, "Matched dynamic version 1."]
FormatCoordinates[pt_, Dynamic@dates_,
Dynamic@(times : {{_, _, _Real} ..}), Dynamic@indicators_] :=
Block[{}, "Matched dynamic version 2."]
In[208]:= FormatCoordinates[dummy, timestamps, bars, indicators]
Out[208]= "Matched non-dynamic version 1."
In[209]:= FormatCoordinates[dummy, Dynamic@timestamps, Dynamic@bars,
Dynamic@indicators]
Out[209]= "Matched dynamic version 1."
In[210]:= FormatCoordinates[dummy, dates, times, indicators]
Out[210]= "Matched non-dynamic version 2."
In[211]:= FormatCoordinates[dummy, Dynamic@dates, Dynamic@times,
Dynamic@indicators]
Out[211]= "Matched dynamic version 1."
UPDATE: Read @Kuba's comment in the answer below for the solution.