represents a function that has been loaded from a library.
- ForeignFunction objects are returned by functions like ForeignFunctionLoad.
- The function represented by ForeignFunction runs in the same process as the Wolfram Language kernel.
- The function represented by ForeignFunction can share data with the Wolfram Language kernel.
- The function represented by ForeignFunction is unloaded when the Wolfram Language kernel exits.
- Information for a ForeignFunction may include the following properties:
"ArgumentTypes" types of arguments "File" name of the library file "Function" name of the loaded function "ReturnType" return type "Type" full type "FunctionPointer" memory address
- Arguments expecting a pointer type can also be passed a ManagedObject containing a pointer.
- ForeignFunction objects loaded in one kernel session may not be valid in another.
Examplesopen allclose all
Wolfram Research (2023), ForeignFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/ForeignFunction.html.
Wolfram Language. 2023. "ForeignFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ForeignFunction.html.
Wolfram Language. (2023). ForeignFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ForeignFunction.html