Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Equivalent to Needs, but does not modify the $ContextPath
ResourceFunction["NeedsDefinitions"]["context`"] loads an appropriate file if the specified context is not already in $Packages and leaves $ContextPath unchanged. | |
ResourceFunction["NeedsDefinitions"]["context`","file"] loads file if the specified context is not already in $Packages. |
Read in the file for the Computer Arithmetic Package if it has not already been read:
In[1]:= |
The context path is unchanged:
In[2]:= |
Out[2]= |
Symbols defined in the package can be used by their fully qualified names:
In[3]:= |
Out[3]= |
In[4]:= |
Out[4]= |
Write a function that loads definitions in another package if needed while avoiding naming conflicts:
In[5]:= |
In[6]:= |
Out[6]= |
Since HypothesisTesting` is kept off the context path, there is no naming conflict with MeanCI:
In[7]:= |
Out[7]= |
This work is licensed under a Creative Commons Attribution 4.0 International License