Skip to content
Language Guide

Modules & Imports

Learn how to organize your Tulpar code with modules and imports.

1 min read

You can include other Tulpar files using the import keyword. This allows you to reuse code and organize your project.

// Import a file
import "examples/utils.tpr";
// Use functions from the imported file
int result = topla(10, 20);
print("Result:", result);

Imported files share the same global state. Variables defined in an imported file are accessible in the importing file.

Shared State