There are several objects available to any program.
This is an object representing your program. The file passed as an argument to the compiler contains the module definition. Therefore, the module object contains all other objects and definitions of your program.
This is a representation of void type. Every other object inherits
The root object contains language intrinsics. These are directives, basic types, and other objects available to any program.
Also, the root is a last resort of the name lookup. This means that if some name can’t be found in the object hierarchy of the program, it will be searched for in the root.
Here are some of the objects nested inside the root as its fields:
Every basic type is represented by a built-in object, accessible as a field of root:
||64-bit floating point number|
||Immutable link to another object|
||A link to another object, which can be modified at run time|
||Array, which elements could be modified at run time|
||A prototype of every directive|
||A prototype of every macro|
||Makes the members of another module or object available in the file this directive appears in.|
||Makes another object or module available in the file this directive appears in, and optionally declares an alias for it.|
Modules can be reused in your program.
Use namespace and
directives exist for that.
For example, the following code:
Use module 'Console'
makes all public members of
Console module available in the current file.
And this code:
Use object _ from 'Console' as 'con'
creates an alias
con for module
Console visible in the current file. You can
access the fields of
Console by the code like this:
Con: main Con: print