DefineResourceFunction
defines a resource function that can be applied to arguments to give the same result as f[…].
DefineResourceFunction[f,name]
uses name as the name of the resource function.
Details and Options
- DefineResourceFunction[…] returns ResourceFunction[…].
- DefineResourceFunction[f,…] immediately stores all definitions on which f[…] depends. If the definitions change later, values obtained from ResourceFunction[…][…] will not be affected.
- In DefineResourceFunction[f,…], f can be any expression.
- In DefineResourceFunction[f], the resource function produced will have name SymbolName[f] if f is a symbol.
- DefineResourceFunction[Unevaluated[f],…] defines a resource function for a symbol f, without evaluating the symbol.
- If a name cannot be inferred from f, a unique name will be assigned.
- The definitions set up by DefineResourceFunction will not persist past the end of the session.
- CloudDeploy, CloudPublish, LocalCache, etc. can be used to store persistent versions of a resource function.
- Use a definition notebook from File ▶ New ▶ Repository Item ▶ Function Repository Item to create a resource function with properties.
Examples
open allclose allBasic Examples (2)
Create a new ResourceFunction:
Create a ResourceFunction from a symbol:
Text
Wolfram Research (2019), DefineResourceFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/DefineResourceFunction.html.
CMS
Wolfram Language. 2019. "DefineResourceFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/DefineResourceFunction.html.
APA
Wolfram Language. (2019). DefineResourceFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DefineResourceFunction.html