Repository navigation
Modules
Martin S. edited this page Oct 7, 2026
·
10 revisions
Modules are scope seperators used to organise classes, static field & static properties under shared name.
Firstly use the keyword module then name and double dot defining scope, lastly don't forget about end keyword to close the scope.
module Lorem:
endFirst definition:
Lorem => Module
Ipsum => Class
Dolor => Method
Second definition:
Sit => Module
Amet => Class
Dolor => Method
Defined method Consectetur (second definition) accesses method Dolor firstly through its module, secondly class and then its definition.
module Lorem:
public class Ipsum:
public static method Dolor()
end
end
end
module Sit:
public class Amet:
public static method Consectetur()
Lorem.Ipsum.Dolor();
end
end
endFile based module is defined once on top of the file and everything under is included in the module.
- This type of definition doesn't require end keyword to close the scope.
module Lorem;
public class Ipsum:
public static method Dolor()
end
endOnly one file based module can be defined for this entire file.
- When defining another one under it will not compile with exception %exceptionHere%
module Lorem;
public class Ipsum:
public static method Dolor()
end
end
module Sit;
public class Amet:
public static method Consectetur()
Lorem.Ipsum.Dolor();
end
end- Adipiscing and Elit are in family Sit.
module Sit;
module Sit.Adipiscing;
module Sit.Elit;