Skip to content

Cross module referencing

Cross module referencing is simple. Simply bind a constant to the value of use("path/to/file_without_extension")

The .scar extension must be omitted when importing other scar files, this is done for brevity and conciseness.

An example of cross module referencing:

val file1 = use("file1")

pub def main()
  file1.some_function()
end

And then inside file1.scar in the same directory:

pub def some_function()
  @puts("doing some thing")
end