Exposing Symbols to $ContextPath

后端 未结 2 1461
轻奢々
轻奢々 2021-02-02 10:57

There are a variety of Internal`context functions that are useful, such as InheritedBlock, Bag and StuffBag, etc., as well as many useful Developer` fu

2条回答
  •  野的像风
    2021-02-02 11:49

    A variation of Leonid's answer which applies on an earlier stage:

    InternalSymbols={"Bag","BagLength","BagPart","StuffBag"}
    $PreRead=#/.(InternalSymbols/.{s_String:>s->"Internal`"<>s})&
    

    After typing this in a notebook, typing

    ?Bag
    

    gives me

    Internal`Bag
    Attributes[Internal`Bag]={Protected}
    

    while

    ?AbsSquare
    

    gives

    Information::notfound: Symbol AbsSquare not found.
    

    but

    ?Internal`AbsSquare
    

    gives

    Internal`AbsSquare
    Attributes[Internal`AbsSquare]={Listable,NumericFunction,Protected}
    

    However it seems to only work in the notebook interface, not when using math on the command line.

提交回复
热议问题