Modules & Imports
Learn how to organize your Tulpar code with modules and 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.
Shared State
Output