x++ / Documents / Packages

Table of Contents

About

Packages are x++ files written by other people that can be imported to your x++ project using the imp operator:

imp "examplePackage"

All packages are located in the pkgs/ folder. If one is not found, the interpreter will automatically create one. When attempting to import a package, the interpreter will look for the pkgs/<package>/main.xpp file. If one is not found, an error is thrown.

Imported packages are only available in that one specific file. When attempting to use the package elsewhere, an error is thrown.

You can use an imported package by referencing the package name and then followed by a dot and the section name like so:

imp "examplePackage"

examplePackage.mySection

The same applies to importing files.

To import a file from the x++ project, the path must contain the .xpp extension. The interpreter will then attempt to find the file from the current working directory. If one is not found, an error is thrown.

Currently, the standard library is built into the x++ interpreter. You can install more packages from GitHub.


Last Updated: March 9th, 2024 by iiPython

↑ Go To Top