FullForm
strips the context for any symbol that can be found on the Append[$ContextPath, $Context]
: FullForm[System`List]
is displayed List
, but I would like to get System`List
for debugging and learning purposes.
I tried $ContextPath = {}
but then the whole front-end stops working [1].
Is there another way besides
Hold[...] /. x_Symbol :> (Context@x <> SymbolName@Unevaluated@x)
Is there any case where this would not work?
[1] I find it strange that the internal code of the FrontEnd relies on the "usability features" $Context
and $ContextPath
. Why doesn't it use the full symbol names for any code it uses (or produces)? IMO $ContextPath = {}
should hurt you (having to type the full name of any symbols not in $Context
), but not the system. If it really needs System`
to operate properly, it should not allow setting $ContextPath = {}
just like it is not allowed to set $Context
to something invalid.
[2] Note that Context
has HoldFirst
while SymbolName
doesn't, hence the Unevaluated
.