Internal Representation of ?name and ??name
To programmatically find the internal representation of the shortforms, you can use MakeExpression
, which gives the result wrapped in HoldComplete
. Here's an example:
MakeExpression@"?name"
(* HoldComplete[Information["name", LongForm -> False]] *)
MakeExpression@"??name"
(* HoldComplete[Information["name", LongForm -> True]] *)
Here are a couple of alternatives to R.M's method for seeing what Mathematica makes of input.
The input forms of every line entered are stored in the DownValues
of In
.
Starting with a new session or after using Quit[]
, evaluating each in a separate Cell:
?Mod
??Plus
DownValues[In]
{HoldPattern[In[1]] :> Information["Mod", LongForm -> False], HoldPattern[In[2]] :> Information["Plus", LongForm -> True], HoldPattern[In[3]] :> DownValues[In]}
Alternatively you could set a $Pre
function to echo input:
$Pre = Function[, Print@Unevaluated@#; #, HoldAll];
?Plus
Information["Plus", LongForm -> False]
x+y+z represents a sum of terms. >>