In another question here, I saw this
poincareMetric[u_?VectorQ, v_?VectorQ] :=
...
Whilst I am familiar with the syntax label_Type, e.g. x_Real, I had not seen this form, but when I tried to search the MMA documentation I found that searching for _?
returned no results and neither _
or ?
on their own suggested to me a clear meaning for _?
- especially since I would have written u_List
for u_?VectorQ
So,
1/ What does _?
actually mean, and
2/ What is this function definition doing that would not be done by e.g. u_List
?
but most importantly,
3/ How does one search for help on such terse syntactic constructions effectively? (So as not to ask almost trivial questions here)
_?
is a single unit. It's_
and?
separately. You can search for both. $\endgroup$?
produces precisely three results. It has two uses in Mathematica syntax and one in regular expressions. Go to Help -> Wolfram Documentation, type?
and hit Enter. Use the builtin documentation, not Google or the Wolfram website. $\endgroup$