You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Andy Arvanitis edited this page Jul 26, 2019
·
3 revisions
C++11 target foreign exports
Foreign values are resolved dynamically/lazily (and "cached" thereafter), so you don't need to define all of them right away. If needed and missing during runtime, an exception will be thrown. Using a source-level debugger which supports C++ will reveal the missing implementation easily enough.
To implement foreign values to be exported:
Create a C++ source file (typically in your_workspace/ffi)
#include purescript.h and any other C/C++ dependencies
Use macros FOREIGN_BEGIN( Module_Name ) and FOREIGN_END to delineate your block of exported values. For example: