# ? (Definition) versus ?? (Information)

What is the difference between ? Definition and ?? Information?

If I define two functions for the same symbol

f[x_] := Cos[x]
f[b_, c_] := Sin[b c]


I get the same result for ?f and ??f

I've read the documentation, but it's not giving me a real sense of the difference. Are there different use cases? Can I always use one of these (? or ??) and ignore the other?

ps. Which tags are appropriate for this question?

• try this – chris Apr 9 '15 at 9:22
• ?... is the same as Information[..., LongForm -> False] and different from Definition. – Szabolcs Apr 9 '15 at 16:42

Actually, while the input escape ?? is shorthand for Information, ? is not a shorthand for Definition (though ? might use Definition). Basically, if there is a usage message defined, ? returns that, if not, it returns definitions. Information and ?? always return everything accessible. Compare:

In[25]:= f[x_] := Cos[x]
f[b_, c_] := Sin[b c]
f::usage = "blahblah";

Definition@f

 f[x_] := Cos[x]

f[b_, c_] := Sin[b c]

?f (* prints usage message if exists, Definitions[f] otherwise *)

  blahblah

Information@f (* same as ??f *)

blahblah

f[x_]:=Cos[x]

f[b_,c_]:=Sin[b c]


According to the documentation under Document Constructs:

Of course, any definition is only printed if the symbol is not ReadProtected. Information itself is ReadProtected, hence only attributes and options are listed:

Definition@Information

Attributes[Information] = {HoldAll, Protected, ReadProtected}

Options[Information] = {LongForm -> True}


Compare the above to the extensive output produced by PrintDefinitions, that delves deep into the symbol's definition (large output is omitted):

Needs["GeneralUtilities"];
PrintDefinitions@Information


Furthermore, you can abuse the ? operator to ask about multiple functions:

?*Chart
`