Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Evaluate an expression when a package is first loaded
ResourceFunction["RunBeforeLoading"][code,"context`"] creates an event handler that evaluates code when "context`" is first loaded. |
Print a message when a context is first loaded:
| In[1]:= |
| Out[1]= |
| In[2]:= |
Check to see what file is used to load a paclet:
| In[3]:= | ![]() |
| Out[3]= |
| In[4]:= | ![]() |
| Out[4]= |
An auto-loading context that is already loaded will no longer trigger the loading event:
| In[7]:= | ![]() |
| Out[7]= |
| In[8]:= | ![]() |
| Out[8]= |
Run in a new session instead:
| In[9]:= | ![]() |
| Out[9]= |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License