Code
FullForm[Hold[?name]]
Syntax::bktmcp: Expression "Hold[?name]]" has no closing "]".
Syntax::sntxi: Incomplete expression; more input is needed .
Question
This is exercise 3.2 (page 47) of Power Programming w/ Mathematica
The task is:
"determine the internal representation of the expressions ?name and ??name"
The above is what I tried. It failed. How do I win?
Answer
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]] *)
Comments
Post a Comment