Skip to main content
added 6 characters in body
Source Link
Kuba
  • 138.9k
  • 13
  • 297
  • 803

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 frontendFrontEnd 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 HoldFirstHoldFirst while SymbolNameSymbolName doesn't, hence the Unevaluated.

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.

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.

added 112 characters in body
Source Link
masterxilo
  • 5.8k
  • 20
  • 41

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@x)?

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.

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@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.

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.

Tweeted twitter.com/StackMma/status/749651994294489089
Routine clean-up
Source Link
m_goldberg
  • 108.6k
  • 16
  • 107
  • 263

`FullForm` FullForm with context for each symbol?

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*working [1].

Is there another way besides Hold[...] /. x_Symbol :> (Context@x <> SymbolName@x)? Is there any case where this would not work?


*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. [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.

`FullForm` with context for each symbol?

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*.

Is there another way besides Hold[...] /. x_Symbol :> (Context@x <> SymbolName@x)? Is there any case where this would not work?


*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.

FullForm with context for each symbol?

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@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.

Source Link
masterxilo
  • 5.8k
  • 20
  • 41
Loading