11

In Programmatic formatting for Mathematica code - possible? masterxilo proposed to use <<GeneralUtilities` then GeneralUtilities`PrintDefinitions@f whereby f is some mathematica code to get a pretty-printed, formatted version of ??f.

How can I find out what is contained in the GeneralUtilities package?

mrz
  • 11,686
  • 2
  • 25
  • 81
  • 4
    These are internal functions which are not supported and most are not documented. So you are on your own to figure out what they do, and expect things to break. Use ?GeneralUtilities`* to find what symbols exist in that context, as with any other package/context. – Szabolcs Sep 26 '16 at 12:43
  • 2
    @Szabolcs This is a perfect answer, so why, pray tell me, why not thee put it as such? – István Zachar Sep 26 '16 at 17:28
  • 1
    The content of the GeneralUtilities package is version dependent. E.g., AccurateTiming (a precursor of RepeatedTiming) no longer exists. – Karsten7 Sep 26 '16 at 17:52

2 Answers2

8

You can query the context of GeneralUtilities` or any other context using

?GeneralUtilities`*

Reference: Information.

Keep in mind that this context/package contains internal functions, most of which are completely undocumented and none of which are supported. You are on your own to figure out what these functions do, and do expect things to break.

Szabolcs
  • 234,956
  • 30
  • 623
  • 1,263
4

I just realized that we can print all symbols in GeneralUtilities that have a documentation string defined:

documentationStrings = 
  Quiet@With[{names = 
      DeleteCases[Names["GeneralUtilities`*"], "Buzz"]},
    Cases[
     MessageName[#, "usage"] & /@
      Symbol /@ 
       names[[;; 
          First@FirstPosition[names, _?(StringContainsQ["$"]), 
             Heads -> False] - 1]],
     _?StringQ
     ]];
Length@documentationStrings (* 180 *)
StringRiffle[documentationStrings, "\n\n"]

For 13.2, it prints 180 usage strings, starting with

enter image description here

See here for a full list.

Victor K.
  • 5,146
  • 3
  • 21
  • 34