Details and Options
Symbols defined in the package loaded by ResourceFunction["GetDefinitions"] can be used by their fully qualified names.
If name is the name of a Wolfram Language context ending with a ` context mark character, then ResourceFunction["GetDefinitions"] will process this name to find the file to read.
For a name of the form "context`", ResourceFunction["GetDefinitions"] will by default search for the following files:
context.mx | file in DumpSave format |
context.mx/$SystemID/context.mx | file in DumpSave format for your computer system |
context.wl | file in the Wolfram Language source format |
context/Kernel/init.wl | kernel initialization file for a particular directory |
context/init.wl | general initialization file for a particular directory |
context.m | file in the Wolfram Language source format |
context/Kernel/ | kernel initialization file for a particular directory |
context/ | general initialization file for a particular directory |
For a name of the form "context`subcontext`", ResourceFunction["GetDefinitions"] will by default search for "subcontext`" inside a directory named "context".
If name is the name of a file, any extension must be included explicitly.
The following options can be given:
Syntax errors in Wolfram Language input files are reported in the standard form
filename: line: syntax error in expr.
ResourceFunction["GetDefinitions"] continues attempting to read a file even after a syntax error has been detected. However, if an error is detected,
$Context and
$ContextPath are reset to the values they had when
ResourceFunction["GetDefinitions"] was called.
ResourceFunction["GetDefinitions"] can read .nb notebook files, returning the low-level box constructs that represent them.
ResourceFunction["GetDefinitions"][CloudObject[…]] can be used to get files from the cloud.
ResourceFunction["GetDefinitions"][LocalObject[…]] can be used to get files from local persistent storage.
ResourceFunction["GetDefinitions"][Databin[…]] gets the contents of a databin in the Wolfram Data Drop.
When operating on a local file, the global variables
$Input and
$InputFileName are set to the file name and the full path of the file being read, respectively, during the execution of
ResourceFunction["GetDefinitions"].
With the
Method option, the stream is opened using the given input stream method. This overrides the default way that
ResourceFunction["GetDefinitions"] resolves file names. The value of the method option can be any member of
$InputStreamMethods.