Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Create a symbol for each named resource function
ResourceFunction["CreateResourceFunctionSymbols"][] defines a symbol for each named ResourceFunction in the "RF`" context. | |
ResourceFunction["CreateResourceFunctionSymbols"]["ctx`"] defines symbols in the given context. | |
ResourceFunction["CreateResourceFunctionSymbols"]["ctx`",{"name1","name2",…}] only defines symbols for the given names. | |
ResourceFunction["CreateResourceFunctionSymbols"]["ctx`",names,"op"] performs the operation specified by "op" on names. |
OverwriteTarget | False | whether to redefine the target symbol if it already exists |
ExcludedContexts | Automatic | a list of contexts that should be protected from changes |
ResourceSystemBase | Automatic | the resource system to obtain names from |
AllowUnknownNames | True | whether to set definitions for unknown resource names |
"List" | list the symbols created |
"Remove" | remove the symbols created |
"Create" | equivalent to the two-argument form |
Create symbols for each resource function:
In[1]:= | ![]() |
Out[1]= | ![]() |
Use a resource function as a symbol:
In[2]:= | ![]() |
Out[2]= | ![]() |
Specify the context:
In[3]:= | ![]() |
Out[3]= | ![]() |
Use a resource function from the new context:
In[4]:= | ![]() |
Out[4]= | ![]() |
Define a single resource function:
In[5]:= | ![]() |
Out[5]= | ![]() |
Use it:
In[6]:= | ![]() |
Out[6]= | ![]() |
Define a specific set of resource functions:
In[7]:= | ![]() |
Out[7]= | ![]() |
Try them out:
In[8]:= | ![]() |
Out[8]= | ![]() |
List symbols created by CreateResourceFunctionSymbols:
In[9]:= | ![]() |
Out[9]= | ![]() |
Other symbols are not included in this list:
In[10]:= | ![]() |
In[11]:= | ![]() |
Out[11]= | ![]() |
Compare to Names:
In[12]:= | ![]() |
Out[12]= | ![]() |
Remove symbols created by CreateResourceFunctionSymbols:
In[13]:= | ![]() |
Out[13]= | ![]() |
Other symbols are not removed:
In[14]:= | ![]() |
Out[14]= | ![]() |
By default, existing symbols with definitions won't be redefined:
In[15]:= | ![]() |
In[16]:= | ![]() |
Out[16]= | ![]() |
In[17]:= | ![]() |
Out[17]= | ![]() |
The definition is unchanged:
In[18]:= | ![]() |
Out[18]= | ![]() |
Overwrite any existing symbols:
In[19]:= | ![]() |
Out[19]= | ![]() |
In[20]:= | ![]() |
Out[20]= | ![]() |
By default, some contexts are protected:
In[21]:= | ![]() |
Out[21]= | ![]() |
Override this protection (at your own risk):
In[22]:= | ![]() |
Out[22]= | ![]() |
In[23]:= | ![]() |
Out[23]= | ![]() |
In[24]:= | ![]() |
Out[24]= | ![]() |
By default, CreateResourceFunctionSymbol will allow defining symbols for names that are not recognized:
In[25]:= | ![]() |
Out[25]= | ![]() |
These symbols will fail at runtime if used before the corresponding ResourceFunction exists:
In[26]:= | ![]() |
Out[26]= | ![]() |
Use "AllowUnknownNames"->False to ensure that unrecognized names will cause a failure:
In[27]:= | ![]() |
Out[27]= | ![]() |
Define all resource functions from a particular category:
In[28]:= | ![]() |
Out[28]= | ![]() |
In[29]:= | ![]() |
Out[29]= | ![]() |
In[30]:= | ![]() |
Out[30]= | ![]() |
Create symbols in the current context to reference resource functions by their base name:
In[31]:= | ![]() |
Use the resource functions FoldRight, Stereogram3D and StringFunction:
In[32]:= | ![]() |
Out[32]= | ![]() |
In[33]:= | ![]() |
Out[33]= | ![]() |
In[34]:= | ![]() |
Out[34]= | ![]() |
Get the list of created symbols:
In[35]:= | ![]() |
Out[35]= | ![]() |
In[36]:= | ![]() |
Out[36]= | ![]() |
Symbols that have already been created by CreateResourceFunctionSymbols are returned as Missing objects:
In[37]:= | ![]() |
Out[37]= | ![]() |
In[38]:= | ![]() |
Out[38]= | ![]() |
In[39]:= | ![]() |
Out[39]= | ![]() |
User-created resource functions will also be included if they are discoverable by name:
In[40]:= | ![]() |
Out[40]= | ![]() |
In[41]:= | ![]() |
In[42]:= | ![]() |
Out[42]= | ![]() |
Create a resource function symbol:
In[43]:= | ![]() |
Out[43]= | ![]() |
Check the definition:
In[44]:= | ![]() |
Out[44]= | ![]() |
The definition changes after the symbol is used for the first time:
In[45]:= | ![]() |
Out[45]= | ![]() |
In[46]:= | ![]() |
Out[46]= | ![]() |
Locked symbols cannot be overwritten:
In[47]:= | ![]() |
In[48]:= | ![]() |
Out[48]= | ![]() |
In[49]:= | ![]() |
Out[49]= | ![]() |
In[50]:= | ![]() |
Out[50]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License