Toitlang uses import to use code from other libraries.
- local import starting with .
$ tree
.
└── my_lib
├── my_lib.toit
├── other.toit
└── sub
└── sub.toit
Assume we are importing sub.toit into my_lib.toit.
import .sub.sub
Shorten version:
import .sub
- global import
import math
Then for customizations,
import math as m
import math show sin cos