Modules & Imports
Importing Files
Section titled “Importing Files”You can include other Tulpar files using the import keyword. This allows you to reuse code and organize your project.
// Import a fileimport "examples/utils.tpr";
// Use functions from the imported fileint result = topla(10, 20);print("Result:", result);Shared State
Section titled “Shared State”Imported files share the same global state. Variables defined in an imported file are accessible in the importing file.
// In utils.tprfloat PI = 3.14159;
// In main.tprimport "utils.tpr";print("PI:", PI);