2
$\begingroup$

This question already has an answer here:

Both in V10.2:

Windows enter image description here

Linux enter image description here

So is ? not the same as Information? But in the help files, it looks like ? is a short form for Information ??

$\endgroup$

marked as duplicate by Mr.Wizard Aug 10 '15 at 6:29

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ Related, possible duplicate: (8126) $\endgroup$ – Mr.Wizard Aug 10 '15 at 6:27
5
$\begingroup$

This looks very weird indeed. Here's my theory on what happens.


First, what is ?something equivalent to exactly? It's the same as

Information["something", LongForm -> False]

Note that I wrote "something" in quotes. This is not exactly the same as Information[something] (without quotes). ? is one of those operators that, when appearing at the beginning of the line, will cause the following characters to be interpreted as a string. << is another example of such an operator.

Keeping this subtlety in mind, ? and Information behave in exactly the same way.


Now what about the second weirdness, i.e. that if using a symbol name (not a string), then Information does return the usage message even though the VariationalMethods package was not loaded?

My best guess is that it's because the usage messages for the standard add-ons are replaced by Mathematica with messages stored in $InstallationDirectory/SystemFiles/Kernel/TextResources/Language/Usage.m (replace Language by your version's language, typically English). I think this is both to allow translations and to have nicely formatted messages with 2D math inside.

It seems that symbols from builtin packages seem to be in this strange state of semi-existence that Names will claim that they don't exist but creating them will immediately load their usage message. This is very similar to the Stub attribute, but Attributes["VariationalMethods`VariationalD"] doesn't find the symbol either.

$\endgroup$
  • $\begingroup$ I think your first observation is correct; consider MakeExpression[RowBox[{"?", "foo"}], StandardForm] $\endgroup$ – Michael E2 Aug 9 '15 at 21:42
  • $\begingroup$ I gave this same explaination, perhaps in a bit more detail, in answer to (91216), only to follow the Linked question and see this existing answer of yours. I think these two questions are effectively the same, and I would like to merge them. Do you consider that appropriate? And if I do merge them do you feel that my answer will infringe upon yours? $\endgroup$ – Mr.Wizard Aug 10 '15 at 6:24
  • 1
    $\begingroup$ Actually, after a bit of consideration I am closing this question as a duplicate of (8126) as it does not introduce new material. However (91216) does raise a new question, though as it happens you already answered it here. How should we handle this? $\endgroup$ – Mr.Wizard Aug 10 '15 at 6:31
  • $\begingroup$ @Mr.Wizard I agree that it is a duplicate. I'm not particularly worried about this kind of "infringement" :-) Go ahead and merge if you like. $\endgroup$ – Szabolcs Aug 10 '15 at 7:53
2
$\begingroup$

Information has an option LongForm.

?... is equivalent to

Information[..., LongForm -> False]

??... is equivalent to

Information[..., LongForm -> True]

$\endgroup$
  • $\begingroup$ So either way, Information[] is equivalent to one of the ? or ??. But neither [1] nor [2] is working, while [3] is working. $\endgroup$ – Chen Stats Yu Aug 9 '15 at 16:34
  • $\begingroup$ What I am trying to understand is, (from the linux screenshot), if there is equivalence, I would expect Input[1] or Input[2] to have the same Output as [3]. $\endgroup$ – Chen Stats Yu Aug 9 '15 at 16:38
  • 1
    $\begingroup$ I think the reason for [3] working is explained in my answer to your other question. $\endgroup$ – m_goldberg Aug 9 '15 at 16:39
  • $\begingroup$ Yes, in this case, that makes sense. I will play around more with these in different order, with fresh kernels. $\endgroup$ – Chen Stats Yu Aug 9 '15 at 16:41
  • $\begingroup$ Perhaps "equivalent" is too strong a term. The front-end processing for ? and ??, done to translate them into their FullForm, is different from what the more formal Information[...] receives, and that may account for the difference you see. "translates to" might be a better term than "equivalent" $\endgroup$ – m_goldberg Aug 9 '15 at 16:49

Not the answer you're looking for? Browse other questions tagged or ask your own question.