Skip to content

Importables

Arda Özcan edited this page Sep 13, 2020 · 1 revision

Table of Contents

Importables

Packages

Packages are single Boink files and their functions can be read and executed by other Boink scripts.

Importing

with a file hierarchy like this:

  • project
    • main.boink
    • utils.boink

in main.boink:

import utils

# Calling a function from utils
utils.func()

Libraries

Libraries are directories that contain Boink files. Which means libraries are containers of packages.

Importing

with a file hierarchy like this:

  • project
    • main.boink
    • library
      • utils.boink

in main.boink:

import library

# Calling a function from utils
library.utils.func()

or directly import a sub-package

import library.utils

# Calling a function from utils
utils.func()

Standard Libraries

Standard libraries are exceptional as they were written in C#. Even though they are called libraries because of the common naming convention, they are imported like Boink packages as they are actually C# classes.

Standard libraries are interfaces between Boink and the system. Since Boink is a high-level language, it needs C# to perform low level operations.

Importing

See a list of standard libraries in wiki home page

import io

# Calling a function from io
io.write("not hello world")

Clone this wiki locally