LibraryFunction
LibraryFunction [args]
represents a function that has been loaded from a Wolfram Library.
Details
- LibraryFunction is returned by functions such as LibraryFunctionLoad .
- A LibraryFunction object can be used the same way as a pure function.
- The function represented by LibraryFunction runs in the same process as the Wolfram Language kernel.
- The function represented by LibraryFunction can share data with the Wolfram Language kernel.
- Functions in libraries loaded by LibraryFunctionLoad can make callbacks to the Wolfram Language.
- The function represented by LibraryFunction is unloaded when the Wolfram Language kernel exits.
- LibraryFunctionUnload unloads a LibraryFunction so that it can no longer be used.
- The default name of functions declared with LibraryFunctionDeclaration is LibraryFunction ["externalName"] for use in compiled code.
- LibraryFunction ["externalName"] can be used in compiled code to call certain functions from the C standard library.
- Information for a LibraryFunction may include the following properties:
-
"ArgumentTypes" types of arguments"File" name of the library file"Function" name of the loaded function"ReturnType" return type of the loaded function
Examples
Basic Examples (1)
Load a function from a sample library:
Call the function:
Tech Notes
Related Guides
Text
Wolfram Research (2010), LibraryFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/LibraryFunction.html (updated 2019).
CMS
Wolfram Language. 2010. "LibraryFunction." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/LibraryFunction.html.
APA
Wolfram Language. (2010). LibraryFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LibraryFunction.html
BibTeX
@misc{reference.wolfram_2025_libraryfunction, author="Wolfram Research", title="{LibraryFunction}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/LibraryFunction.html}", note=[Accessed: 11-April-2025 ]}
BibLaTeX
@online{reference.wolfram_2025_libraryfunction, organization={Wolfram Research}, title={LibraryFunction}, year={2019}, url={https://reference.wolfram.com/language/ref/LibraryFunction.html}, note=[Accessed: 11-April-2025 ]}